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

Side by Side Diff: chrome/browser/android/dev_tools_server.cc

Issue 23477033: Implementing URL prefix match for history thumbnail cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replacing ASSERT_TRUE() << ... to NOTREACHED() << ... Created 7 years, 3 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/android/most_visited_sites.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/android/dev_tools_server.h" 5 #include "chrome/browser/android/dev_tools_server.h"
6 6
7 #include <pwd.h> 7 #include <pwd.h>
8 #include <cstring> 8 #include <cstring>
9 9
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 virtual base::FilePath GetDebugFrontendDir() OVERRIDE { 68 virtual base::FilePath GetDebugFrontendDir() OVERRIDE {
69 return base::FilePath(); 69 return base::FilePath();
70 } 70 }
71 71
72 virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE { 72 virtual std::string GetPageThumbnailData(const GURL& url) OVERRIDE {
73 Profile* profile = 73 Profile* profile =
74 ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); 74 ProfileManager::GetLastUsedProfile()->GetOriginalProfile();
75 history::TopSites* top_sites = profile->GetTopSites(); 75 history::TopSites* top_sites = profile->GetTopSites();
76 if (top_sites) { 76 if (top_sites) {
77 scoped_refptr<base::RefCountedMemory> data; 77 scoped_refptr<base::RefCountedMemory> data;
78 if (top_sites->GetPageThumbnail(url, &data)) 78 if (top_sites->GetPageThumbnail(url, false, &data))
79 return std::string(reinterpret_cast<const char*>(data->front()), 79 return std::string(reinterpret_cast<const char*>(data->front()),
80 data->size()); 80 data->size());
81 } 81 }
82 return ""; 82 return "";
83 } 83 }
84 84
85 virtual content::RenderViewHost* CreateNewTarget() OVERRIDE { 85 virtual content::RenderViewHost* CreateNewTarget() OVERRIDE {
86 Profile* profile = 86 Profile* profile =
87 g_browser_process->profile_manager()->GetDefaultProfile(); 87 g_browser_process->profile_manager()->GetDefaultProfile();
88 TabModel* tab_model = TabModelList::GetTabModelWithProfile(profile); 88 TabModel* tab_model = TabModelList::GetTabModelWithProfile(profile);
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 jobject obj, 213 jobject obj,
214 jint server, 214 jint server,
215 jboolean enabled) { 215 jboolean enabled) {
216 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server); 216 DevToolsServer* devtools_server = reinterpret_cast<DevToolsServer*>(server);
217 if (enabled) { 217 if (enabled) {
218 devtools_server->Start(); 218 devtools_server->Start();
219 } else { 219 } else {
220 devtools_server->Stop(); 220 devtools_server->Stop();
221 } 221 }
222 } 222 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/most_visited_sites.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698