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

Side by Side Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 10352016: Consolidate RenderWidgetHost::CopyFromBackingStore and RenderWidgetHost::AsyncCopyFromBackingStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 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 | « no previous file | chrome/browser/tab_contents/thumbnail_generator.cc » ('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) 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/browser/extensions/extension_tabs_module.h" 5 #include "chrome/browser/extensions/extension_tabs_module.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 if (!GetExtension()->CanCaptureVisiblePage(web_contents->GetURL(), &error_)) 1663 if (!GetExtension()->CanCaptureVisiblePage(web_contents->GetURL(), &error_))
1664 return false; 1664 return false;
1665 1665
1666 RenderViewHost* render_view_host = web_contents->GetRenderViewHost(); 1666 RenderViewHost* render_view_host = web_contents->GetRenderViewHost();
1667 content::RenderWidgetHostView* view = render_view_host->GetView(); 1667 content::RenderWidgetHostView* view = render_view_host->GetView();
1668 if (!view) { 1668 if (!view) {
1669 error_ = keys::kInternalVisibleTabCaptureError; 1669 error_ = keys::kInternalVisibleTabCaptureError;
1670 return false; 1670 return false;
1671 } 1671 }
1672 skia::PlatformCanvas* temp_canvas = new skia::PlatformCanvas; 1672 skia::PlatformCanvas* temp_canvas = new skia::PlatformCanvas;
1673 render_view_host->AsyncCopyFromBackingStore( 1673 render_view_host->CopyFromBackingStore(
1674 gfx::Rect(), 1674 gfx::Rect(),
1675 view->GetViewBounds().size(), 1675 view->GetViewBounds().size(),
1676 temp_canvas, 1676 temp_canvas,
1677 base::Bind(&CaptureVisibleTabFunction::CopyFromBackingStoreComplete, 1677 base::Bind(&CaptureVisibleTabFunction::CopyFromBackingStoreComplete,
1678 this, 1678 this,
1679 base::Owned(temp_canvas))); 1679 base::Owned(temp_canvas)));
1680 return true; 1680 return true;
1681 } 1681 }
1682 1682
1683 void CaptureVisibleTabFunction::CopyFromBackingStoreComplete( 1683 void CaptureVisibleTabFunction::CopyFromBackingStoreComplete(
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 // called for every API call the extension made. 1847 // called for every API call the extension made.
1848 GotLanguage(language); 1848 GotLanguage(language);
1849 } 1849 }
1850 1850
1851 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { 1851 void DetectTabLanguageFunction::GotLanguage(const std::string& language) {
1852 result_.reset(Value::CreateStringValue(language.c_str())); 1852 result_.reset(Value::CreateStringValue(language.c_str()));
1853 SendResponse(true); 1853 SendResponse(true);
1854 1854
1855 Release(); // Balanced in Run() 1855 Release(); // Balanced in Run()
1856 } 1856 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/tab_contents/thumbnail_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698