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

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

Issue 6246007: Generate thumbnails in the browser process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix the function name... Created 9 years, 11 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
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/render_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 UMA_HISTOGRAM_MEDIUM_TIMES("Renderer4.LanguageDetection", 1234 UMA_HISTOGRAM_MEDIUM_TIMES("Renderer4.LanguageDetection",
1235 base::TimeTicks::Now() - begin_time); 1235 base::TimeTicks::Now() - begin_time);
1236 } 1236 }
1237 // Send the text to the browser for indexing (the browser might decide not 1237 // Send the text to the browser for indexing (the browser might decide not
1238 // to index, if the URL is HTTPS for instance) and language discovery. 1238 // to index, if the URL is HTTPS for instance) and language discovery.
1239 Send(new ViewHostMsg_PageContents( 1239 Send(new ViewHostMsg_PageContents(
1240 routing_id_, url, load_id, contents, language, 1240 routing_id_, url, load_id, contents, language,
1241 TranslateHelper::IsPageTranslatable(&document))); 1241 TranslateHelper::IsPageTranslatable(&document)));
1242 } 1242 }
1243 1243
1244 OnCaptureThumbnail(); 1244 // Generate the thumbnail here if the in-browser thumbnailing isn't
1245 // enabled. TODO(satorux): Remove this and related code once
1246 // crbug.com/65936 is complete.
1247 if (!CommandLine::ForCurrentProcess()->HasSwitch(
1248 switches::kEnableInBrowserThumbnailing)) {
1249 OnCaptureThumbnail();
1250 }
1245 1251
1246 if (phishing_delegate_.get()) 1252 if (phishing_delegate_.get())
1247 phishing_delegate_->FinishedLoad(&contents); 1253 phishing_delegate_->FinishedLoad(&contents);
1248 } 1254 }
1249 1255
1250 void RenderView::CaptureText(WebFrame* frame, string16* contents) { 1256 void RenderView::CaptureText(WebFrame* frame, string16* contents) {
1251 contents->clear(); 1257 contents->clear();
1252 if (!frame) 1258 if (!frame)
1253 return; 1259 return;
1254 1260
(...skipping 3893 matching lines...) Expand 10 before | Expand all | Expand 10 after
5148 5154
5149 webkit::ppapi::PluginInstance* RenderView::GetBitmapForOptimizedPluginPaint( 5155 webkit::ppapi::PluginInstance* RenderView::GetBitmapForOptimizedPluginPaint(
5150 const gfx::Rect& paint_bounds, 5156 const gfx::Rect& paint_bounds,
5151 TransportDIB** dib, 5157 TransportDIB** dib,
5152 gfx::Rect* location, 5158 gfx::Rect* location,
5153 gfx::Rect* clip) { 5159 gfx::Rect* clip) {
5154 return pepper_delegate_.GetBitmapForOptimizedPluginPaint( 5160 return pepper_delegate_.GetBitmapForOptimizedPluginPaint(
5155 paint_bounds, dib, location, clip); 5161 paint_bounds, dib, location, clip);
5156 } 5162 }
5157 5163
5164 gfx::Size RenderView::GetScrollOffset() {
5165 WebKit::WebSize scroll_offset = webview()->mainFrame()->scrollOffset();
5166 return gfx::Size(scroll_offset.width, scroll_offset.height);
5167 }
5168
5158 void RenderView::OnClearFocusedNode() { 5169 void RenderView::OnClearFocusedNode() {
5159 if (webview()) 5170 if (webview())
5160 webview()->clearFocusedNode(); 5171 webview()->clearFocusedNode();
5161 } 5172 }
5162 5173
5163 void RenderView::OnSetBackground(const SkBitmap& background) { 5174 void RenderView::OnSetBackground(const SkBitmap& background) {
5164 if (webview()) 5175 if (webview())
5165 webview()->setIsTransparent(!background.empty()); 5176 webview()->setIsTransparent(!background.empty());
5166 5177
5167 SetBackground(background); 5178 SetBackground(background);
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
5693 if (cmd == kJavaScriptStressTestSetStressRunType) { 5704 if (cmd == kJavaScriptStressTestSetStressRunType) {
5694 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); 5705 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param));
5695 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { 5706 } else if (cmd == kJavaScriptStressTestPrepareStressRun) {
5696 v8::Testing::PrepareStressRun(param); 5707 v8::Testing::PrepareStressRun(param);
5697 } 5708 }
5698 } 5709 }
5699 5710
5700 void RenderView::OnContextMenuClosed() { 5711 void RenderView::OnContextMenuClosed() {
5701 context_menu_node_.reset(); 5712 context_menu_node_.reset();
5702 } 5713 }
OLDNEW
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/renderer/render_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698