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

Side by Side Diff: chrome/browser/debugger/browser_list_tabcontents_provider.cc

Issue 10985041: DevTools: request page thumbnails from the devtools handler delegate, do not redirect to chrome://t… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android delegate updated. Created 8 years, 2 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/browser/debugger/browser_list_tabcontents_provider.h" 5 #include "chrome/browser/debugger/browser_list_tabcontents_provider.h"
6 6
7 #include "chrome/browser/history/top_sites.h" 7 #include "chrome/browser/history/top_sites.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_manager.h"
9 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_list.h" 11 #include "chrome/browser/ui/browser_list.h"
11 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
12 #include "grit/devtools_discovery_page_resources.h" 13 #include "grit/devtools_discovery_page_resources.h"
13 #include "net/url_request/url_request_context_getter.h" 14 #include "net/url_request/url_request_context_getter.h"
14 #include "ui/base/layout.h" 15 #include "ui/base/layout.h"
15 #include "ui/base/resource/resource_bundle.h" 16 #include "ui/base/resource/resource_bundle.h"
16 17
17 using content::DevToolsHttpHandlerDelegate; 18 using content::DevToolsHttpHandlerDelegate;
18 19
(...skipping 29 matching lines...) Expand all
48 49
49 bool BrowserListTabContentsProvider::BundlesFrontendResources() { 50 bool BrowserListTabContentsProvider::BundlesFrontendResources() {
50 // We'd like front-end to be served from the WebUI via proxy, hence 51 // We'd like front-end to be served from the WebUI via proxy, hence
51 // pretend we don't have it bundled. 52 // pretend we don't have it bundled.
52 return false; 53 return false;
53 } 54 }
54 55
55 std::string BrowserListTabContentsProvider::GetFrontendResourcesBaseURL() { 56 std::string BrowserListTabContentsProvider::GetFrontendResourcesBaseURL() {
56 return "chrome-devtools://devtools/"; 57 return "chrome-devtools://devtools/";
57 } 58 }
59
60 std::string BrowserListTabContentsProvider::GetPageThumbnailData(
61 const GURL& url) {
62 for (BrowserList::const_iterator it = BrowserList::begin(),
63 end = BrowserList::end(); it != end; ++it) {
64 Profile* profile = (*it)->profile();
65 history::TopSites* top_sites = profile->GetTopSites();
66 if (!top_sites)
67 continue;
68 scoped_refptr<base::RefCountedMemory> data;
69 if (top_sites->GetPageThumbnail(url, &data))
70 return std::string(
71 reinterpret_cast<const char*>(data->front()), data->size());
72 }
73
74 return std::string();
75 }
OLDNEW
« no previous file with comments | « chrome/browser/debugger/browser_list_tabcontents_provider.h ('k') | content/browser/debugger/devtools_http_handler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698