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