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/renderer/chrome_render_view_observer.h" | 5 #include "chrome/renderer/chrome_render_view_observer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 OnSetClientSidePhishingDetection) | 205 OnSetClientSidePhishingDetection) |
206 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetVisuallyDeemphasized, | 206 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetVisuallyDeemphasized, |
207 OnSetVisuallyDeemphasized) | 207 OnSetVisuallyDeemphasized) |
208 #if defined(OS_CHROMEOS) | 208 #if defined(OS_CHROMEOS) |
209 IPC_MESSAGE_HANDLER(ChromeViewMsg_StartFrameSniffer, OnStartFrameSniffer) | 209 IPC_MESSAGE_HANDLER(ChromeViewMsg_StartFrameSniffer, OnStartFrameSniffer) |
210 #endif | 210 #endif |
211 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetFPS, OnGetFPS) | 211 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetFPS, OnGetFPS) |
212 IPC_MESSAGE_HANDLER(ChromeViewMsg_AddStrictSecurityHost, | 212 IPC_MESSAGE_HANDLER(ChromeViewMsg_AddStrictSecurityHost, |
213 OnAddStrictSecurityHost) | 213 OnAddStrictSecurityHost) |
214 IPC_MESSAGE_HANDLER(ChromeViewMsg_NPAPINotSupported, OnNPAPINotSupported) | 214 IPC_MESSAGE_HANDLER(ChromeViewMsg_NPAPINotSupported, OnNPAPINotSupported) |
| 215 #if defined(OS_ANDROID) |
| 216 IPC_MESSAGE_HANDLER(ChromeViewMsg_UpdateTopControlsState, |
| 217 OnUpdateTopControlsState) |
| 218 #endif |
215 IPC_MESSAGE_UNHANDLED(handled = false) | 219 IPC_MESSAGE_UNHANDLED(handled = false) |
216 IPC_END_MESSAGE_MAP() | 220 IPC_END_MESSAGE_MAP() |
217 | 221 |
218 // Filter only. | 222 // Filter only. |
219 IPC_BEGIN_MESSAGE_MAP(ChromeRenderViewObserver, message) | 223 IPC_BEGIN_MESSAGE_MAP(ChromeRenderViewObserver, message) |
220 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering); | 224 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering); |
221 IPC_END_MESSAGE_MAP() | 225 IPC_END_MESSAGE_MAP() |
222 | 226 |
223 return handled; | 227 return handled; |
224 } | 228 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } | 276 } |
273 | 277 |
274 void ChromeRenderViewObserver::OnNPAPINotSupported() { | 278 void ChromeRenderViewObserver::OnNPAPINotSupported() { |
275 #if defined(USE_AURA) && defined(OS_WIN) | 279 #if defined(USE_AURA) && defined(OS_WIN) |
276 content_settings_->BlockNPAPIPlugins(); | 280 content_settings_->BlockNPAPIPlugins(); |
277 #else | 281 #else |
278 NOTREACHED(); | 282 NOTREACHED(); |
279 #endif | 283 #endif |
280 } | 284 } |
281 | 285 |
| 286 #if defined(OS_ANDROID) |
| 287 void ChromeRenderViewObserver::OnUpdateTopControlsState( |
| 288 content::TopControlsState constraints, |
| 289 content::TopControlsState current, |
| 290 bool animate) { |
| 291 render_view()->UpdateTopControlsState(constraints, current, animate); |
| 292 } |
| 293 #endif |
| 294 |
282 void ChromeRenderViewObserver::Navigate(const GURL& url) { | 295 void ChromeRenderViewObserver::Navigate(const GURL& url) { |
283 // Execute cache clear operations that were postponed until a navigation | 296 // Execute cache clear operations that were postponed until a navigation |
284 // event (including tab reload). | 297 // event (including tab reload). |
285 if (chrome_render_process_observer_) | 298 if (chrome_render_process_observer_) |
286 chrome_render_process_observer_->ExecutePendingClearCache(); | 299 chrome_render_process_observer_->ExecutePendingClearCache(); |
287 } | 300 } |
288 | 301 |
289 void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( | 302 void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( |
290 bool enable_phishing_detection) { | 303 bool enable_phishing_detection) { |
291 #if defined(FULL_SAFE_BROWSING) && !defined(OS_CHROMEOS) | 304 #if defined(FULL_SAFE_BROWSING) && !defined(OS_CHROMEOS) |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 if (!external_host_bindings_.get()) { | 807 if (!external_host_bindings_.get()) { |
795 external_host_bindings_.reset(new ExternalHostBindings( | 808 external_host_bindings_.reset(new ExternalHostBindings( |
796 render_view(), routing_id())); | 809 render_view(), routing_id())); |
797 } | 810 } |
798 return external_host_bindings_.get(); | 811 return external_host_bindings_.get(); |
799 } | 812 } |
800 | 813 |
801 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 814 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
802 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 815 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
803 } | 816 } |
OLD | NEW |