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

Side by Side Diff: chrome/browser/ui/android/javascript_app_modal_dialog_android.cc

Issue 1153813003: Add user_gesture param to WebContentsDelegate::ActivateContents Base URL: https://chromium.googlesource.com/chromium/src.git@ug1_WebContentsImpl_Activate
Patch Set: Update callers Created 5 years, 7 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/android/javascript_app_modal_dialog_android.h" 5 #include "chrome/browser/ui/android/javascript_app_modal_dialog_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "chrome/browser/ui/app_modal/chrome_javascript_native_dialog_factory.h" 9 #include "chrome/browser/ui/app_modal/chrome_javascript_native_dialog_factory.h"
10 #include "components/app_modal/app_modal_dialog_queue.h" 10 #include "components/app_modal/app_modal_dialog_queue.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 167
168 class ChromeJavaScriptNativeDialogAndroidFactory 168 class ChromeJavaScriptNativeDialogAndroidFactory
169 : public app_modal::JavaScriptNativeDialogFactory { 169 : public app_modal::JavaScriptNativeDialogFactory {
170 public: 170 public:
171 ChromeJavaScriptNativeDialogAndroidFactory() {} 171 ChromeJavaScriptNativeDialogAndroidFactory() {}
172 ~ChromeJavaScriptNativeDialogAndroidFactory() override {} 172 ~ChromeJavaScriptNativeDialogAndroidFactory() override {}
173 173
174 private: 174 private:
175 app_modal::NativeAppModalDialog* CreateNativeJavaScriptDialog( 175 app_modal::NativeAppModalDialog* CreateNativeJavaScriptDialog(
176 app_modal::JavaScriptAppModalDialog* dialog) override { 176 app_modal::JavaScriptAppModalDialog* dialog) override {
177 // TODO(johnme): Can we sometimes be certain this was for a user gesture?
177 dialog->web_contents()->GetDelegate()->ActivateContents( 178 dialog->web_contents()->GetDelegate()->ActivateContents(
178 dialog->web_contents()); 179 dialog->web_contents(), false /* user_gesture */);
179 return new JavascriptAppModalDialogAndroid( 180 return new JavascriptAppModalDialogAndroid(
180 base::android::AttachCurrentThread(), 181 base::android::AttachCurrentThread(),
181 dialog, dialog->web_contents()->GetTopLevelNativeWindow()); 182 dialog, dialog->web_contents()->GetTopLevelNativeWindow());
182 } 183 }
183 184
184 DISALLOW_COPY_AND_ASSIGN(ChromeJavaScriptNativeDialogAndroidFactory); 185 DISALLOW_COPY_AND_ASSIGN(ChromeJavaScriptNativeDialogAndroidFactory);
185 }; 186 };
186 187
187 } // namespace 188 } // namespace
188 189
189 void InstallChromeJavaScriptNativeDialogFactory() { 190 void InstallChromeJavaScriptNativeDialogFactory() {
190 app_modal::JavaScriptDialogManager::GetInstance()-> 191 app_modal::JavaScriptDialogManager::GetInstance()->
191 SetNativeDialogFactory( 192 SetNativeDialogFactory(
192 make_scoped_ptr(new ChromeJavaScriptNativeDialogAndroidFactory)); 193 make_scoped_ptr(new ChromeJavaScriptNativeDialogAndroidFactory));
193 } 194 }
194 195
OLDNEW
« no previous file with comments | « chrome/browser/task_manager/task_manager.cc ('k') | chrome/browser/ui/blocked_content/app_modal_dialog_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698