Use USER_WANTS_NO_MORE_DIALOGS constant for -1 magic number
This commit is contained in:
parent
a5a068b2ee
commit
731240e0e9
1 changed files with 6 additions and 2 deletions
|
@ -17,6 +17,10 @@
|
|||
|
||||
using content::JavaScriptDialogType;
|
||||
|
||||
namespace {
|
||||
constexpr int USER_WANTS_NO_MORE_DIALOGS = -1;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
|
||||
AtomJavaScriptDialogManager::AtomJavaScriptDialogManager(
|
||||
|
@ -36,7 +40,7 @@ void AtomJavaScriptDialogManager::RunJavaScriptDialog(
|
|||
origin_counts_[origin] = 0;
|
||||
}
|
||||
|
||||
if (origin_counts_[origin] == -1) {
|
||||
if (origin_counts_[origin] == USER_WANTS_NO_MORE_DIALOGS) {
|
||||
return callback.Run(false, base::string16());
|
||||
}
|
||||
|
||||
|
@ -92,7 +96,7 @@ void AtomJavaScriptDialogManager::OnMessageBoxCallback(
|
|||
int code,
|
||||
bool checkbox_checked) {
|
||||
if (checkbox_checked) {
|
||||
(*origin_counts_)[origin] = -1;
|
||||
(*origin_counts_)[origin] = USER_WANTS_NO_MORE_DIALOGS;
|
||||
}
|
||||
callback.Run(code == 0, base::string16());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue