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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // Constants for mixed-content blocking. | 153 // Constants for mixed-content blocking. |
154 static const char kGoogleDotCom[] = "google.com"; | 154 static const char kGoogleDotCom[] = "google.com"; |
155 static const char kFacebookDotCom[] = "facebook.com"; | 155 static const char kFacebookDotCom[] = "facebook.com"; |
156 static const char kTwitterDotCom[] = "twitter.com"; | 156 static const char kTwitterDotCom[] = "twitter.com"; |
157 | 157 |
158 static bool PaintViewIntoCanvas(WebView* view, | 158 static bool PaintViewIntoCanvas(WebView* view, |
159 skia::PlatformCanvas& canvas) { | 159 skia::PlatformCanvas& canvas) { |
160 view->layout(); | 160 view->layout(); |
161 const WebSize& size = view->size(); | 161 const WebSize& size = view->size(); |
162 | 162 |
163 if (!canvas.initialize(size.width, size.height, true)) | 163 if (!canvas.initialize(size.width, size.height, |
| 164 skia::PlatformDevice::FLAGS_OPAQUE)) |
164 return false; | 165 return false; |
165 | 166 |
166 view->paint(webkit_glue::ToWebCanvas(&canvas), | 167 view->paint(webkit_glue::ToWebCanvas(&canvas), |
167 WebRect(0, 0, size.width, size.height)); | 168 WebRect(0, 0, size.width, size.height)); |
168 // TODO: Add a way to snapshot the whole page, not just the currently | 169 // TODO: Add a way to snapshot the whole page, not just the currently |
169 // visible part. | 170 // visible part. |
170 | 171 |
171 return true; | 172 return true; |
172 } | 173 } |
173 | 174 |
(...skipping 875 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 |