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" |
20 #include "chrome/browser/ui/android/bluetooth_chooser_android.h" | 21 #include "chrome/browser/ui/android/bluetooth_chooser_android.h" |
21 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 22 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
22 #include "chrome/browser/ui/browser_navigator.h" | 23 #include "chrome/browser/ui/browser_navigator.h" |
23 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 24 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
24 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 25 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
25 #include "chrome/browser/ui/tab_helpers.h" | 26 #include "chrome/browser/ui/tab_helpers.h" |
26 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
27 #include "components/app_modal/javascript_dialog_manager.h" | 28 #include "components/app_modal/javascript_dialog_manager.h" |
28 #include "content/public/browser/notification_details.h" | 29 #include "content/public/browser/notification_details.h" |
29 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 108 |
108 scoped_ptr<BluetoothChooser> | 109 scoped_ptr<BluetoothChooser> |
109 ChromeWebContentsDelegateAndroid::RunBluetoothChooser( | 110 ChromeWebContentsDelegateAndroid::RunBluetoothChooser( |
110 content::WebContents* web_contents, | 111 content::WebContents* web_contents, |
111 const BluetoothChooser::EventHandler& event_handler, | 112 const BluetoothChooser::EventHandler& event_handler, |
112 const GURL& origin) { | 113 const GURL& origin) { |
113 return make_scoped_ptr( | 114 return make_scoped_ptr( |
114 new BluetoothChooserAndroid(web_contents, event_handler, origin)); | 115 new BluetoothChooserAndroid(web_contents, event_handler, origin)); |
115 } | 116 } |
116 | 117 |
| 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 |
117 void ChromeWebContentsDelegateAndroid::CloseContents( | 129 void ChromeWebContentsDelegateAndroid::CloseContents( |
118 WebContents* web_contents) { | 130 WebContents* web_contents) { |
119 // Prevent dangling registrations assigned to closed web contents. | 131 // Prevent dangling registrations assigned to closed web contents. |
120 if (notification_registrar_.IsRegistered(this, | 132 if (notification_registrar_.IsRegistered(this, |
121 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, | 133 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, |
122 content::Source<WebContents>(web_contents))) { | 134 content::Source<WebContents>(web_contents))) { |
123 notification_registrar_.Remove(this, | 135 notification_registrar_.Remove(this, |
124 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, | 136 chrome::NOTIFICATION_FIND_RESULT_AVAILABLE, |
125 content::Source<WebContents>(web_contents)); | 137 content::Source<WebContents>(web_contents)); |
126 } | 138 } |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 jboolean IsCapturingVideo(JNIEnv* env, | 412 jboolean IsCapturingVideo(JNIEnv* env, |
401 const JavaParamRef<jclass>& clazz, | 413 const JavaParamRef<jclass>& clazz, |
402 const JavaParamRef<jobject>& java_web_contents) { | 414 const JavaParamRef<jobject>& java_web_contents) { |
403 content::WebContents* web_contents = | 415 content::WebContents* web_contents = |
404 content::WebContents::FromJavaWebContents(java_web_contents); | 416 content::WebContents::FromJavaWebContents(java_web_contents); |
405 scoped_refptr<MediaStreamCaptureIndicator> indicator = | 417 scoped_refptr<MediaStreamCaptureIndicator> indicator = |
406 MediaCaptureDevicesDispatcher::GetInstance()-> | 418 MediaCaptureDevicesDispatcher::GetInstance()-> |
407 GetMediaStreamCaptureIndicator(); | 419 GetMediaStreamCaptureIndicator(); |
408 return indicator->IsCapturingVideo(web_contents); | 420 return indicator->IsCapturingVideo(web_contents); |
409 } | 421 } |
OLD | NEW |