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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetClientSidePhishingDetection, | 256 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetClientSidePhishingDetection, |
257 OnSetClientSidePhishingDetection) | 257 OnSetClientSidePhishingDetection) |
258 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetVisuallyDeemphasized, | 258 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetVisuallyDeemphasized, |
259 OnSetVisuallyDeemphasized) | 259 OnSetVisuallyDeemphasized) |
260 #if defined(OS_CHROMEOS) | 260 #if defined(OS_CHROMEOS) |
261 IPC_MESSAGE_HANDLER(ChromeViewMsg_StartFrameSniffer, OnStartFrameSniffer) | 261 IPC_MESSAGE_HANDLER(ChromeViewMsg_StartFrameSniffer, OnStartFrameSniffer) |
262 #endif | 262 #endif |
263 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetFPS, OnGetFPS) | 263 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetFPS, OnGetFPS) |
264 IPC_MESSAGE_HANDLER(ChromeViewMsg_AddStrictSecurityHost, | 264 IPC_MESSAGE_HANDLER(ChromeViewMsg_AddStrictSecurityHost, |
265 OnAddStrictSecurityHost) | 265 OnAddStrictSecurityHost) |
266 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetAsInterstitial, OnSetAsInterstitial) | |
267 IPC_MESSAGE_UNHANDLED(handled = false) | 266 IPC_MESSAGE_UNHANDLED(handled = false) |
268 IPC_END_MESSAGE_MAP() | 267 IPC_END_MESSAGE_MAP() |
269 | 268 |
270 // Filter only. | 269 // Filter only. |
271 IPC_BEGIN_MESSAGE_MAP(ChromeRenderViewObserver, message) | 270 IPC_BEGIN_MESSAGE_MAP(ChromeRenderViewObserver, message) |
272 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering); | 271 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering); |
273 IPC_END_MESSAGE_MAP() | 272 IPC_END_MESSAGE_MAP() |
274 | 273 |
275 return handled; | 274 return handled; |
276 } | 275 } |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 void ChromeRenderViewObserver::OnSetAllowRunningInsecureContent(bool allow) { | 353 void ChromeRenderViewObserver::OnSetAllowRunningInsecureContent(bool allow) { |
355 allow_running_insecure_content_ = allow; | 354 allow_running_insecure_content_ = allow; |
356 OnSetAllowDisplayingInsecureContent(allow); | 355 OnSetAllowDisplayingInsecureContent(allow); |
357 } | 356 } |
358 | 357 |
359 void ChromeRenderViewObserver::OnAddStrictSecurityHost( | 358 void ChromeRenderViewObserver::OnAddStrictSecurityHost( |
360 const std::string& host) { | 359 const std::string& host) { |
361 strict_security_hosts_.insert(host); | 360 strict_security_hosts_.insert(host); |
362 } | 361 } |
363 | 362 |
364 void ChromeRenderViewObserver::OnSetAsInterstitial() { | |
365 content_settings_->SetAsInterstitial(); | |
366 } | |
367 | |
368 void ChromeRenderViewObserver::Navigate(const GURL& url) { | 363 void ChromeRenderViewObserver::Navigate(const GURL& url) { |
369 // Execute cache clear operations that were postponed until a navigation | 364 // Execute cache clear operations that were postponed until a navigation |
370 // event (including tab reload). | 365 // event (including tab reload). |
371 if (chrome_render_process_observer_) | 366 if (chrome_render_process_observer_) |
372 chrome_render_process_observer_->ExecutePendingClearCache(); | 367 chrome_render_process_observer_->ExecutePendingClearCache(); |
373 AboutHandler::MaybeHandle(url); | 368 AboutHandler::MaybeHandle(url); |
374 } | 369 } |
375 | 370 |
376 void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( | 371 void ChromeRenderViewObserver::OnSetClientSidePhishingDetection( |
377 bool enable_phishing_detection) { | 372 bool enable_phishing_detection) { |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 reinterpret_cast<const unsigned char*>(&data[0]); | 1051 reinterpret_cast<const unsigned char*>(&data[0]); |
1057 | 1052 |
1058 return decoder.Decode(src_data, data.size()); | 1053 return decoder.Decode(src_data, data.size()); |
1059 } | 1054 } |
1060 return SkBitmap(); | 1055 return SkBitmap(); |
1061 } | 1056 } |
1062 | 1057 |
1063 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 1058 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
1064 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 1059 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
1065 } | 1060 } |
OLD | NEW |