| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetClientSidePhishingDetection, | 262 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetClientSidePhishingDetection, |
| 263 OnSetClientSidePhishingDetection) | 263 OnSetClientSidePhishingDetection) |
| 264 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetVisuallyDeemphasized, | 264 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetVisuallyDeemphasized, |
| 265 OnSetVisuallyDeemphasized) | 265 OnSetVisuallyDeemphasized) |
| 266 #if defined(OS_CHROMEOS) | 266 #if defined(OS_CHROMEOS) |
| 267 IPC_MESSAGE_HANDLER(ChromeViewMsg_StartFrameSniffer, OnStartFrameSniffer) | 267 IPC_MESSAGE_HANDLER(ChromeViewMsg_StartFrameSniffer, OnStartFrameSniffer) |
| 268 #endif | 268 #endif |
| 269 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetFPS, OnGetFPS) | 269 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetFPS, OnGetFPS) |
| 270 IPC_MESSAGE_HANDLER(ChromeViewMsg_AddStrictSecurityHost, | 270 IPC_MESSAGE_HANDLER(ChromeViewMsg_AddStrictSecurityHost, |
| 271 OnAddStrictSecurityHost) | 271 OnAddStrictSecurityHost) |
| 272 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetAsInterstitial, OnSetAsInterstitial) | |
| 273 IPC_MESSAGE_UNHANDLED(handled = false) | 272 IPC_MESSAGE_UNHANDLED(handled = false) |
| 274 IPC_END_MESSAGE_MAP() | 273 IPC_END_MESSAGE_MAP() |
| 275 | 274 |
| 276 // Filter only. | 275 // Filter only. |
| 277 IPC_BEGIN_MESSAGE_MAP(ChromeRenderViewObserver, message) | 276 IPC_BEGIN_MESSAGE_MAP(ChromeRenderViewObserver, message) |
| 278 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering); | 277 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering); |
| 279 IPC_END_MESSAGE_MAP() | 278 IPC_END_MESSAGE_MAP() |
| 280 | 279 |
| 281 return handled; | 280 return handled; |
| 282 } | 281 } |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 void ChromeRenderViewObserver::OnSetAllowRunningInsecureContent(bool allow) { | 359 void ChromeRenderViewObserver::OnSetAllowRunningInsecureContent(bool allow) { |
| 361 allow_running_insecure_content_ = allow; | 360 allow_running_insecure_content_ = allow; |
| 362 OnSetAllowDisplayingInsecureContent(allow); | 361 OnSetAllowDisplayingInsecureContent(allow); |
| 363 } | 362 } |
| 364 | 363 |
| 365 void ChromeRenderViewObserver::OnAddStrictSecurityHost( | 364 void ChromeRenderViewObserver::OnAddStrictSecurityHost( |
| 366 const std::string& host) { | 365 const std::string& host) { |
| 367 strict_security_hosts_.insert(host); | 366 strict_security_hosts_.insert(host); |
| 368 } | 367 } |
| 369 | 368 |
| 370 void ChromeRenderViewObserver::OnSetAsInterstitial() { | |
| 371 content_settings_->SetAsInterstitial(); | |
| 372 } | |
| 373 | |
| 374 void ChromeRenderViewObserver::Navigate(const GURL& url) { | 369 void ChromeRenderViewObserver::Navigate(const GURL& url) { |
| 375 // Execute cache clear operations that were postponed until a navigation | 370 // Execute cache clear operations that were postponed until a navigation |
| 376 // event (including tab reload). | 371 // event (including tab reload). |
| 377 if (chrome_render_process_observer_) | 372 if (chrome_render_process_observer_) |
| 378 chrome_render_process_observer_->ExecutePendingClearCache(); | 373 chrome_render_process_observer_->ExecutePendingClearCache(); |
| 379 AboutHandler::MaybeHandle(url); | 374 AboutHandler::MaybeHandle(url); |
| 380 } | 375 } |
| 381 | 376 |
| 382 void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( | 377 void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( |
| 383 bool enable_phishing_detection) { | 378 bool enable_phishing_detection) { |
| (...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 reinterpret_cast<const unsigned char*>(&data[0]); | 1061 reinterpret_cast<const unsigned char*>(&data[0]); |
| 1067 | 1062 |
| 1068 return decoder.Decode(src_data, data.size()); | 1063 return decoder.Decode(src_data, data.size()); |
| 1069 } | 1064 } |
| 1070 return SkBitmap(); | 1065 return SkBitmap(); |
| 1071 } | 1066 } |
| 1072 | 1067 |
| 1073 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 1068 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
| 1074 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 1069 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
| 1075 } | 1070 } |
| OLD | NEW |