Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.cc

Issue 2412843002: Simplify the JavaScriptDialogManager. (Closed)
Patch Set: braces Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h" 5 #include "chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h"
6 6
7 #include "base/feature_list.h" 7 #include "base/feature_list.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "chrome/browser/engagement/site_engagement_service.h" 9 #include "chrome/browser/engagement/site_engagement_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 const base::string16* prompt_override) { 138 const base::string16* prompt_override) {
139 if (!IsEnabled()) { 139 if (!IsEnabled()) {
140 return AppModalDialogManager()->HandleJavaScriptDialog(web_contents, accept, 140 return AppModalDialogManager()->HandleJavaScriptDialog(web_contents, accept,
141 prompt_override); 141 prompt_override);
142 } 142 }
143 143
144 NOTREACHED() << "auto-dismissing dialog code does not yet exist"; 144 NOTREACHED() << "auto-dismissing dialog code does not yet exist";
145 return false; 145 return false;
146 } 146 }
147 147
148 void JavaScriptDialogTabHelper::CancelActiveAndPendingDialogs( 148 void JavaScriptDialogTabHelper::CancelDialogs(
149 content::WebContents* web_contents) { 149 content::WebContents* web_contents,
150 bool suppress_callbacks,
151 bool reset_state) {
150 // Cancel any app-modal dialogs that may be going. 152 // Cancel any app-modal dialogs that may be going.
151 AppModalDialogManager()->CancelActiveAndPendingDialogs(web_contents); 153 if (!IsEnabled()) {
154 return AppModalDialogManager()->CancelDialogs(
155 web_contents, suppress_callbacks, reset_state);
156 }
152 157
153 // More work here for the auto-dismissing dialogs. 158 // More work here for the auto-dismissing dialogs.
154 } 159 }
155
156 void JavaScriptDialogTabHelper::ResetDialogState(
157 content::WebContents* web_contents) {
158 // Reset any app-modal dialog state that may exist.
159 if (!IsEnabled())
160 return AppModalDialogManager()->ResetDialogState(web_contents);
161
162 // More work here for the auto-dismissing dialogs.
163 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/javascript_dialogs/javascript_dialog_tab_helper.h ('k') | components/app_modal/app_modal_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698