| OLD | NEW |
| 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/android/chrome_web_contents_delegate_android.h" | 5 #include "chrome/browser/android/chrome_web_contents_delegate_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 "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/browser/android/feature_utilities.h" | 10 #include "chrome/browser/android/feature_utilities.h" |
| 11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
| 12 #include "chrome/browser/file_select_helper.h" | 12 #include "chrome/browser/file_select_helper.h" |
| 13 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 13 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
| 14 #include "chrome/browser/media/media_stream_capture_indicator.h" | 14 #include "chrome/browser/media/media_stream_capture_indicator.h" |
| 15 #include "chrome/browser/media/protected_media_identifier_permission_context.h" | 15 #include "chrome/browser/media/protected_media_identifier_permission_context.h" |
| 16 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" | 16 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" |
| 17 #include "chrome/browser/prerender/prerender_manager.h" | 17 #include "chrome/browser/prerender/prerender_manager.h" |
| 18 #include "chrome/browser/prerender/prerender_manager_factory.h" | 18 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/ssl/security_state_model.h" | |
| 21 #include "chrome/browser/ui/android/bluetooth_chooser_android.h" | 20 #include "chrome/browser/ui/android/bluetooth_chooser_android.h" |
| 22 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 21 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
| 23 #include "chrome/browser/ui/browser_navigator.h" | 22 #include "chrome/browser/ui/browser_navigator.h" |
| 24 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 23 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
| 25 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 24 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 26 #include "chrome/browser/ui/tab_helpers.h" | 25 #include "chrome/browser/ui/tab_helpers.h" |
| 27 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 28 #include "components/app_modal/javascript_dialog_manager.h" | 27 #include "components/app_modal/javascript_dialog_manager.h" |
| 29 #include "content/public/browser/notification_details.h" | 28 #include "content/public/browser/notification_details.h" |
| 30 #include "content/public/browser/notification_service.h" | 29 #include "content/public/browser/notification_service.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 107 |
| 109 scoped_ptr<BluetoothChooser> | 108 scoped_ptr<BluetoothChooser> |
| 110 ChromeWebContentsDelegateAndroid::RunBluetoothChooser( | 109 ChromeWebContentsDelegateAndroid::RunBluetoothChooser( |
| 111 content::WebContents* web_contents, | 110 content::WebContents* web_contents, |
| 112 const BluetoothChooser::EventHandler& event_handler, | 111 const BluetoothChooser::EventHandler& event_handler, |
| 113 const GURL& origin) { | 112 const GURL& origin) { |
| 114 return make_scoped_ptr( | 113 return make_scoped_ptr( |
| 115 new BluetoothChooserAndroid(web_contents, event_handler, origin)); | 114 new BluetoothChooserAndroid(web_contents, event_handler, origin)); |
| 116 } | 115 } |
| 117 | 116 |
| 118 void ChromeWebContentsDelegateAndroid::VisibleSSLStateChanged( | |
| 119 content::WebContents* web_contents) { | |
| 120 DCHECK(web_contents); | |
| 121 // Notify the model that the security state has changed, so that the | |
| 122 // URL bar updates with up-to-date data computed by the model. | |
| 123 SecurityStateModel* model = SecurityStateModel::FromWebContents(web_contents); | |
| 124 DCHECK(model); | |
| 125 model->SecurityStateChanged(); | |
| 126 WebContentsDelegateAndroid::VisibleSSLStateChanged(web_contents); | |
| 127 } | |
| 128 | |
| 129 void ChromeWebContentsDelegateAndroid::CloseContents( | 117 void ChromeWebContentsDelegateAndroid::CloseContents( |
| 130 WebContents* web_contents) { | 118 WebContents* web_contents) { |
| 131 // Prevent dangling registrations assigned to closed web contents. | 119 // Prevent dangling registrations assigned to closed web contents. |
| 132 if (notification_registrar_.IsRegistered(this, | 120 if (notification_registrar_.IsRegistered(this, |
| 133 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, | 121 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, |
| 134 content::Source<WebContents>(web_contents))) { | 122 content::Source<WebContents>(web_contents))) { |
| 135 notification_registrar_.Remove(this, | 123 notification_registrar_.Remove(this, |
| 136 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, | 124 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, |
| 137 content::Source<WebContents>(web_contents)); | 125 content::Source<WebContents>(web_contents)); |
| 138 } | 126 } |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 jboolean IsCapturingVideo(JNIEnv* env, | 400 jboolean IsCapturingVideo(JNIEnv* env, |
| 413 const JavaParamRef<jclass>& clazz, | 401 const JavaParamRef<jclass>& clazz, |
| 414 const JavaParamRef<jobject>& java_web_contents) { | 402 const JavaParamRef<jobject>& java_web_contents) { |
| 415 content::WebContents* web_contents = | 403 content::WebContents* web_contents = |
| 416 content::WebContents::FromJavaWebContents(java_web_contents); | 404 content::WebContents::FromJavaWebContents(java_web_contents); |
| 417 scoped_refptr<MediaStreamCaptureIndicator> indicator = | 405 scoped_refptr<MediaStreamCaptureIndicator> indicator = |
| 418 MediaCaptureDevicesDispatcher::GetInstance()-> | 406 MediaCaptureDevicesDispatcher::GetInstance()-> |
| 419 GetMediaStreamCaptureIndicator(); | 407 GetMediaStreamCaptureIndicator(); |
| 420 return indicator->IsCapturingVideo(web_contents); | 408 return indicator->IsCapturingVideo(web_contents); |
| 421 } | 409 } |
| OLD | NEW |