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 25 matching lines...) Expand all Loading... |
36 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" | 36 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" |
37 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 37 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" | 38 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" |
39 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 39 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" | 40 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityObjec
t.h" |
41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 41 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 44 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 45 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 46 #include "ui/base/ui_base_switches.h" |
46 #include "ui/gfx/favicon_size.h" | 47 #include "ui/gfx/favicon_size.h" |
47 #include "ui/gfx/size.h" | 48 #include "ui/gfx/size.h" |
48 #include "ui/gfx/skbitmap_operations.h" | 49 #include "ui/gfx/skbitmap_operations.h" |
49 #include "v8/include/v8-testing.h" | 50 #include "v8/include/v8-testing.h" |
50 #include "webkit/glue/image_decoder.h" | 51 #include "webkit/glue/image_decoder.h" |
51 #include "webkit/glue/multi_resolution_image_resource_fetcher.h" | 52 #include "webkit/glue/multi_resolution_image_resource_fetcher.h" |
52 #include "webkit/glue/webkit_glue.h" | 53 #include "webkit/glue/webkit_glue.h" |
53 | 54 |
54 using WebKit::WebAccessibilityObject; | 55 using WebKit::WebAccessibilityObject; |
55 using WebKit::WebCString; | 56 using WebKit::WebCString; |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 bool enable_phishing_detection) { | 301 bool enable_phishing_detection) { |
301 #if defined(FULL_SAFE_BROWSING) && !defined(OS_CHROMEOS) | 302 #if defined(FULL_SAFE_BROWSING) && !defined(OS_CHROMEOS) |
302 phishing_classifier_ = enable_phishing_detection ? | 303 phishing_classifier_ = enable_phishing_detection ? |
303 safe_browsing::PhishingClassifierDelegate::Create( | 304 safe_browsing::PhishingClassifierDelegate::Create( |
304 render_view(), NULL) : | 305 render_view(), NULL) : |
305 NULL; | 306 NULL; |
306 #endif | 307 #endif |
307 } | 308 } |
308 | 309 |
309 void ChromeRenderViewObserver::OnSetVisuallyDeemphasized(bool deemphasized) { | 310 void ChromeRenderViewObserver::OnSetVisuallyDeemphasized(bool deemphasized) { |
310 // TODO(wittman): Remove this function entirely once new style constrained | 311 // TODO(msw|wittman): Remove this function entirely once new style constrained |
311 // window is enabled on the other platforms. | 312 // window is enabled on the other platforms. |
312 #if defined(OS_MACOSX) || defined(OS_WIN) | 313 #if defined(OS_MACOSX) || defined(OS_WIN) |
313 return; | 314 return; |
314 #endif | 315 #endif |
315 | 316 |
316 if (CommandLine::ForCurrentProcess()->HasSwitch( | 317 if (CommandLine::ForCurrentProcess()->HasSwitch( |
317 switches::kEnableChromeStyleDialogs)) { | 318 switches::kEnableNewDialogStyle)) { |
318 bool already_deemphasized = !!dimmed_color_overlay_.get(); | 319 bool already_deemphasized = !!dimmed_color_overlay_.get(); |
319 if (already_deemphasized == deemphasized) | 320 if (already_deemphasized == deemphasized) |
320 return; | 321 return; |
321 | 322 |
322 if (deemphasized) { | 323 if (deemphasized) { |
323 // 70% opaque grey. | 324 // 70% opaque grey. |
324 SkColor greyish = SkColorSetARGB(178, 0, 0, 0); | 325 SkColor greyish = SkColorSetARGB(178, 0, 0, 0); |
325 dimmed_color_overlay_.reset( | 326 dimmed_color_overlay_.reset( |
326 new WebViewColorOverlay(render_view(), greyish)); | 327 new WebViewColorOverlay(render_view(), greyish)); |
327 } else { | 328 } else { |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 if (!external_host_bindings_.get()) { | 844 if (!external_host_bindings_.get()) { |
844 external_host_bindings_.reset(new ExternalHostBindings( | 845 external_host_bindings_.reset(new ExternalHostBindings( |
845 render_view(), routing_id())); | 846 render_view(), routing_id())); |
846 } | 847 } |
847 return external_host_bindings_.get(); | 848 return external_host_bindings_.get(); |
848 } | 849 } |
849 | 850 |
850 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { | 851 bool ChromeRenderViewObserver::IsStrictSecurityHost(const std::string& host) { |
851 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); | 852 return (strict_security_hosts_.find(host) != strict_security_hosts_.end()); |
852 } | 853 } |
OLD | NEW |