Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: chrome/renderer/chrome_render_view_observer.cc

Issue 9416017: Optionally clear PlatformCanvas instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Address style issues. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698