| OLD | NEW |
| 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 Loading... |
| 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 3884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5139 | 5145 |
| 5140 webkit::ppapi::PluginInstance* RenderView::GetBitmapForOptimizedPluginPaint( | 5146 webkit::ppapi::PluginInstance* RenderView::GetBitmapForOptimizedPluginPaint( |
| 5141 const gfx::Rect& paint_bounds, | 5147 const gfx::Rect& paint_bounds, |
| 5142 TransportDIB** dib, | 5148 TransportDIB** dib, |
| 5143 gfx::Rect* location, | 5149 gfx::Rect* location, |
| 5144 gfx::Rect* clip) { | 5150 gfx::Rect* clip) { |
| 5145 return pepper_delegate_.GetBitmapForOptimizedPluginPaint( | 5151 return pepper_delegate_.GetBitmapForOptimizedPluginPaint( |
| 5146 paint_bounds, dib, location, clip); | 5152 paint_bounds, dib, location, clip); |
| 5147 } | 5153 } |
| 5148 | 5154 |
| 5155 gfx::Size RenderView::GetScrollOffset() { |
| 5156 WebKit::WebSize scroll_offset = webview()->mainFrame()->scrollOffset(); |
| 5157 return gfx::Size(scroll_offset.width, scroll_offset.height); |
| 5158 } |
| 5159 |
| 5149 void RenderView::OnClearFocusedNode() { | 5160 void RenderView::OnClearFocusedNode() { |
| 5150 if (webview()) | 5161 if (webview()) |
| 5151 webview()->clearFocusedNode(); | 5162 webview()->clearFocusedNode(); |
| 5152 } | 5163 } |
| 5153 | 5164 |
| 5154 void RenderView::OnSetBackground(const SkBitmap& background) { | 5165 void RenderView::OnSetBackground(const SkBitmap& background) { |
| 5155 if (webview()) | 5166 if (webview()) |
| 5156 webview()->setIsTransparent(!background.empty()); | 5167 webview()->setIsTransparent(!background.empty()); |
| 5157 | 5168 |
| 5158 SetBackground(background); | 5169 SetBackground(background); |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5684 if (cmd == kJavaScriptStressTestSetStressRunType) { | 5695 if (cmd == kJavaScriptStressTestSetStressRunType) { |
| 5685 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 5696 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
| 5686 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 5697 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
| 5687 v8::Testing::PrepareStressRun(param); | 5698 v8::Testing::PrepareStressRun(param); |
| 5688 } | 5699 } |
| 5689 } | 5700 } |
| 5690 | 5701 |
| 5691 void RenderView::OnContextMenuClosed() { | 5702 void RenderView::OnContextMenuClosed() { |
| 5692 context_menu_node_.reset(); | 5703 context_menu_node_.reset(); |
| 5693 } | 5704 } |
| OLD | NEW |