| 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/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
| 16 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/prerender_messages.h" | 17 #include "chrome/common/prerender_messages.h" |
| 18 #include "chrome/common/render_messages.h" | 18 #include "chrome/common/render_messages.h" |
| 19 #include "chrome/common/url_constants.h" | 19 #include "chrome/common/url_constants.h" |
| 20 #include "chrome/renderer/chrome_render_process_observer.h" | 20 #include "chrome/renderer/chrome_render_process_observer.h" |
| 21 #include "chrome/renderer/isolated_world_ids.h" |
| 21 #include "chrome/renderer/prerender/prerender_helper.h" | 22 #include "chrome/renderer/prerender/prerender_helper.h" |
| 22 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" | 23 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" |
| 23 #include "chrome/renderer/translate/translate_helper.h" | |
| 24 #include "chrome/renderer/webview_color_overlay.h" | 24 #include "chrome/renderer/webview_color_overlay.h" |
| 25 #include "components/translate/content/renderer/translate_helper.h" |
| 25 #include "content/public/common/bindings_policy.h" | 26 #include "content/public/common/bindings_policy.h" |
| 26 #include "content/public/renderer/content_renderer_client.h" | 27 #include "content/public/renderer/content_renderer_client.h" |
| 27 #include "content/public/renderer/render_frame.h" | 28 #include "content/public/renderer/render_frame.h" |
| 28 #include "content/public/renderer/render_view.h" | 29 #include "content/public/renderer/render_view.h" |
| 29 #include "extensions/common/constants.h" | 30 #include "extensions/common/constants.h" |
| 31 #include "extensions/renderer/extension_groups.h" |
| 30 #include "net/base/data_url.h" | 32 #include "net/base/data_url.h" |
| 31 #include "skia/ext/platform_canvas.h" | 33 #include "skia/ext/platform_canvas.h" |
| 32 #include "third_party/WebKit/public/platform/WebCString.h" | 34 #include "third_party/WebKit/public/platform/WebCString.h" |
| 33 #include "third_party/WebKit/public/platform/WebRect.h" | 35 #include "third_party/WebKit/public/platform/WebRect.h" |
| 34 #include "third_party/WebKit/public/platform/WebSize.h" | 36 #include "third_party/WebKit/public/platform/WebSize.h" |
| 35 #include "third_party/WebKit/public/platform/WebString.h" | 37 #include "third_party/WebKit/public/platform/WebString.h" |
| 36 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 38 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 37 #include "third_party/WebKit/public/platform/WebVector.h" | 39 #include "third_party/WebKit/public/platform/WebVector.h" |
| 38 #include "third_party/WebKit/public/web/WebAXObject.h" | 40 #include "third_party/WebKit/public/web/WebAXObject.h" |
| 39 #include "third_party/WebKit/public/web/WebDataSource.h" | 41 #include "third_party/WebKit/public/web/WebDataSource.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } | 152 } |
| 151 #endif | 153 #endif |
| 152 | 154 |
| 153 } // namespace | 155 } // namespace |
| 154 | 156 |
| 155 ChromeRenderViewObserver::ChromeRenderViewObserver( | 157 ChromeRenderViewObserver::ChromeRenderViewObserver( |
| 156 content::RenderView* render_view, | 158 content::RenderView* render_view, |
| 157 ChromeRenderProcessObserver* chrome_render_process_observer) | 159 ChromeRenderProcessObserver* chrome_render_process_observer) |
| 158 : content::RenderViewObserver(render_view), | 160 : content::RenderViewObserver(render_view), |
| 159 chrome_render_process_observer_(chrome_render_process_observer), | 161 chrome_render_process_observer_(chrome_render_process_observer), |
| 160 translate_helper_(new TranslateHelper(render_view)), | 162 translate_helper_(new translate::TranslateHelper( |
| 163 render_view, |
| 164 chrome::ISOLATED_WORLD_ID_TRANSLATE, |
| 165 extensions::EXTENSION_GROUP_INTERNAL_TRANSLATE_SCRIPTS, |
| 166 extensions::kExtensionScheme)), |
| 161 phishing_classifier_(NULL), | 167 phishing_classifier_(NULL), |
| 162 capture_timer_(false, false) { | 168 capture_timer_(false, false) { |
| 163 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 169 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 164 if (!command_line.HasSwitch(switches::kDisableClientSidePhishingDetection)) | 170 if (!command_line.HasSwitch(switches::kDisableClientSidePhishingDetection)) |
| 165 OnSetClientSidePhishingDetection(true); | 171 OnSetClientSidePhishingDetection(true); |
| 166 } | 172 } |
| 167 | 173 |
| 168 ChromeRenderViewObserver::~ChromeRenderViewObserver() { | 174 ChromeRenderViewObserver::~ChromeRenderViewObserver() { |
| 169 } | 175 } |
| 170 | 176 |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 WebElement element = node.to<WebElement>(); | 468 WebElement element = node.to<WebElement>(); |
| 463 if (!element.hasHTMLTagName(tag_name)) | 469 if (!element.hasHTMLTagName(tag_name)) |
| 464 continue; | 470 continue; |
| 465 WebString value = element.getAttribute(attribute_name); | 471 WebString value = element.getAttribute(attribute_name); |
| 466 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) | 472 if (value.isNull() || !LowerCaseEqualsASCII(value, "refresh")) |
| 467 continue; | 473 continue; |
| 468 return true; | 474 return true; |
| 469 } | 475 } |
| 470 return false; | 476 return false; |
| 471 } | 477 } |
| OLD | NEW |