Commit graph

37 commits

Author SHA1 Message Date
Samuel Attard
f4434763fe
fix: use file path as key for safeDialogs on filesystem (#17546) 2019-03-27 11:21:10 -07:00
Samuel Attard
2188a6ea99
fix: set default_id and cancel_id correctly on confirm dialogs (#17547) 2019-03-27 11:15:58 -07:00
Jeremy Apthorp
34e54b93a4 Remove WebContentsUserData::kLocatorKey
https://chromium-review.googlesource.com/c/chromium/src/+/1093015
2018-10-09 14:38:00 -07:00
Charles Kerr
d663b4eaee
fix: fix gn cpplint warnings (#14583)
* chore: fix cpplint 'include_what_you_use' warnings

Typically by including <memory>, <utility> etc.

* chore: fix 'static/global string constant' warning

Use C style strings instead of std::string.

Style guide forbids non-trivial static / global variables. https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables

/home/charles/electron/electron-gn/src/electron/script/cpplint.js

* refactor: remove global string variables.

Fix 'global string variables are not permitted' linter warnings
by using the base::NoDestructor<> wrapper to make it explicit that
these variables are never destroyed.

The style guide's take on globals with nontrivial destructors:
https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables

* fix: initializer error introduced in last commit

* fix: remove WIP file that was included by accident

* fix: include order

* fix: include order

* fix: include order

* fix: include order, again
2018-09-12 19:25:56 -05:00
Shelley Vohr
9f328abe19 refactor: remove instances of createDeepCopy (#13703)
* add new native_mate converters for base::Value

* fix converter swapping

* remove createDeepCopy from browser/api

* replace missing ListValue converter

* convert bulk of remaining createDeepCopy instances

* convert last remaining instances of createDeepCopy

* incremental progress and helper methods for value conversion

* convert Get and add template function for GetString

* final DictionaryValue method conversions

* remove usage of base::DictionaryValue in web_contents_preferences

* use IsEnabled helper where possible

* Update atom_api_web_view_manager.cc
2018-08-04 07:23:07 +10:00
deepak1556
a1683eb4e8 Give the JS dialog manager the alerting frame.
https://chromium-review.googlesource.com/c/chromium/src/+/928828
https://chromium-review.googlesource.com/c/chromium/src/+/791517
2018-06-19 11:49:42 +10:00
Milan Burda
45e78728bd chore: move more constants to options_switches.h/cc (#13093)
* Add options::kNativeWindowOpen

* Add options::kSandbox

* Add options::kPlugins

* Add options::kWebSecurity

* Add options::kAllowRunningInsecureContent

* Add options::kOffscreen
2018-05-29 03:09:51 -05:00
Jeremy Apthorp
f1587da480 [chromium-style] out-of-line default constructors and destructors 2018-04-19 11:12:58 -07:00
Shelley Vohr
c6f4bbd143
also format missing .cc files 2018-04-18 20:48:45 -04:00
Cheng Zhao
8fc5c6c862
Refactor NativeWindow (Part 3): Remove is_offscreen_dummy from NativeWindow (#12503)
* Don't use is_offscreen_dummy in MessageBox

* Don't use is_offscreen_dummy in DownloadManagerDelegate

* Don't use is_offscreen_dummy in CommonWebContentsDelegate

* Remove is_offscreen_dummy from NativeWindow
2018-04-03 12:19:35 +09:00
Cheng Zhao
3d47a8a2fd Remove the static getter methods from WebContentsPreferences 2018-03-22 15:20:03 +09:00
Cheng Zhao
d141d2445d Fix build error caused by base::Passed changes 2018-03-20 10:13:16 +03:00
deepak1556
b08d086b0f fix stale rebase 2018-03-20 10:13:16 +03:00
Samuel Attard
0291dc8214 Calling non-const callbacks requires some tricks 2018-03-20 10:08:58 +03:00
Samuel Attard
ce755483ba DialogClosedCallback are not const references anymore 2018-03-20 10:08:58 +03:00
Cheng Zhao
702f1631a3 Remove NativeWindow::FromWebContents 2018-03-06 16:21:17 +09:00
Cheng Zhao
ca42325ade Make OnMessageBoxCallback a method since it is accessing members 2018-03-06 11:35:53 +09:00
Cheng Zhao
7516b059fe Code style fixes 2018-03-06 11:31:56 +09:00
Samuel Attard
7dec3c9320 Fixup cpplint 2018-03-06 11:19:15 +09:00
Samuel Attard
731240e0e9 Use USER_WANTS_NO_MORE_DIALOGS constant for -1 magic number 2018-03-06 11:19:15 +09:00
Charles Kerr
a5a068b2ee fix cpplint errors
atom/browser/atom_javascript_dialog_manager.cc:39:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
atom/browser/atom_javascript_dialog_manager.cc:39:  If/else bodies with multiple statements require braces  [readability/braces] [4]
atom/browser/atom_javascript_dialog_manager.cc:62:  Lines should be <= 80 characters long  [whitespace/line_length] [2]
atom/browser/atom_javascript_dialog_manager.cc:89:  If/else bodies with multiple statements require braces  [readability/braces] [4]
2018-03-06 11:19:15 +09:00
Samuel Attard
795447f61a Implement dialog (alert/confirm) blocking as a user switch after the first dialog
* This is to enable more browser-like behavior so that users who run third-party code
  will not be DOS'ed with alerts and confirms.  This is already handled like this
  in most major browsers so this will greatly help these developers
2018-03-06 11:19:15 +09:00
22222
4044548f3e Add 'will-prevent-unload' event. 2017-05-11 06:35:35 -05:00
Cheng Zhao
fc2d62d5cb Fix API changes of Chrome58 2017-04-27 16:34:52 +09:00
Birunthan Mohanathas
c8c11e68c6 Add support for checkbox with dialog.showMessageBox
This adds the `checkboxLabel` and `checkboxChecked` options to display a
checkbox in the message box. Fixes #6048.
2017-02-09 09:03:54 -08:00
Cheng Zhao
85749e4dbd Update AtomJavaScriptDialogManager 2017-02-06 10:34:28 -08:00
Kevin Sawicki
6ef1a9150c Add OK button to alert 2017-01-09 08:30:13 -08:00
Kevin Sawicki
1f08634d62 Implement alert/confirm through dialog manager 2017-01-09 08:30:13 -08:00
Cheng Zhao
fa0ce7ad5f Adjust to the new behaviors of beforeunload handler 2016-05-23 14:27:39 +09:00
Cheng Zhao
a2bd55dd3c Adapt to changes of Chrome 51 API changes (Part 2) 2016-05-23 12:29:14 +09:00
Cheng Zhao
7ba391da7c Update to API changes of Chrome 51 2016-05-23 10:59:39 +09:00
Cheng Zhao
bfac7f7a17 Make beforeunload work in webview 2015-05-01 13:48:39 +08:00
Kevin Sawicki
b6b6fc3bfd Remove All Rights Reserved after GitHub copyright
Closes #762
2014-10-31 11:17:05 -07:00
Cheng Zhao
e0e1d45859 Rename string16 to base::string16. 2014-06-28 19:49:22 +08:00
Cheng Zhao
f176b2c58f Switch to use MIT license. 2014-05-04 20:29:08 +08:00
Cheng Zhao
2d808d30a2 Bring back build/include_order cpplint. 2014-03-16 09:13:06 +08:00
Cheng Zhao
516d46444d Move all sources under atom/. 2014-03-16 08:30:26 +08:00
Renamed from browser/atom_javascript_dialog_manager.cc (Browse further)