| 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" |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "chrome/common/chrome_constants.h" | 14 #include "chrome/common/chrome_constants.h" |
| 15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 16 #include "chrome/common/icon_messages.h" | 16 #include "chrome/common/icon_messages.h" |
| 17 #include "chrome/common/prerender_messages.h" |
| 17 #include "chrome/common/render_messages.h" | 18 #include "chrome/common/render_messages.h" |
| 18 #include "chrome/common/thumbnail_score.h" | 19 #include "chrome/common/thumbnail_score.h" |
| 19 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 20 #include "chrome/renderer/chrome_render_process_observer.h" | 21 #include "chrome/renderer/chrome_render_process_observer.h" |
| 21 #include "chrome/renderer/content_settings_observer.h" | 22 #include "chrome/renderer/content_settings_observer.h" |
| 22 #include "chrome/renderer/extensions/extension_dispatcher.h" | 23 #include "chrome/renderer/extensions/extension_dispatcher.h" |
| 23 #include "chrome/renderer/external_host_bindings.h" | 24 #include "chrome/renderer/external_host_bindings.h" |
| 24 #include "chrome/renderer/frame_sniffer.h" | 25 #include "chrome/renderer/frame_sniffer.h" |
| 25 #include "chrome/renderer/prerender/prerender_helper.h" | 26 #include "chrome/renderer/prerender/prerender_helper.h" |
| 26 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" | 27 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 IPC_MESSAGE_HANDLER(ChromeViewMsg_StartFrameSniffer, OnStartFrameSniffer) | 261 IPC_MESSAGE_HANDLER(ChromeViewMsg_StartFrameSniffer, OnStartFrameSniffer) |
| 261 #endif | 262 #endif |
| 262 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetFPS, OnGetFPS) | 263 IPC_MESSAGE_HANDLER(ChromeViewMsg_GetFPS, OnGetFPS) |
| 263 IPC_MESSAGE_HANDLER(ChromeViewMsg_AddStrictSecurityHost, | 264 IPC_MESSAGE_HANDLER(ChromeViewMsg_AddStrictSecurityHost, |
| 264 OnAddStrictSecurityHost) | 265 OnAddStrictSecurityHost) |
| 265 IPC_MESSAGE_UNHANDLED(handled = false) | 266 IPC_MESSAGE_UNHANDLED(handled = false) |
| 266 IPC_END_MESSAGE_MAP() | 267 IPC_END_MESSAGE_MAP() |
| 267 | 268 |
| 268 // Filter only. | 269 // Filter only. |
| 269 IPC_BEGIN_MESSAGE_MAP(ChromeRenderViewObserver, message) | 270 IPC_BEGIN_MESSAGE_MAP(ChromeRenderViewObserver, message) |
| 270 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetIsPrerendering, OnSetIsPrerendering); | 271 IPC_MESSAGE_HANDLER(PrerenderMsg_SetIsPrerendering, OnSetIsPrerendering); |
| 271 IPC_END_MESSAGE_MAP() | 272 IPC_END_MESSAGE_MAP() |
| 272 | 273 |
| 273 return handled; | 274 return handled; |
| 274 } | 275 } |
| 275 | 276 |
| 276 void ChromeRenderViewObserver::OnWebUIJavaScript( | 277 void ChromeRenderViewObserver::OnWebUIJavaScript( |
| 277 const string16& frame_xpath, | 278 const string16& frame_xpath, |
| 278 const string16& jscript, | 279 const string16& jscript, |
| 279 int id, | 280 int id, |
| 280 bool notify_result) { | 281 bool notify_result) { |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 reinterpret_cast<const unsigned char*>(&data[0]); | 1050 reinterpret_cast<const unsigned char*>(&data[0]); |
| 1050 | 1051 |
| 1051 return decoder.Decode(src_data, data.size()); | 1052 return decoder.Decode(src_data, data.size()); |
| 1052 } | 1053 } |
| 1053 return SkBitmap(); | 1054 return SkBitmap(); |
| 1054 } | 1055 } |
| 1055 | 1056 |
| 1056 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 1057 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
| 1057 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 1058 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
| 1058 } | 1059 } |
| OLD | NEW |