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

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

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra inclusion from testing_profile.h Created 5 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/android/dev_tools_server.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_manager_delegate_android.h" 5 #include "chrome/browser/android/dev_tools_manager_delegate_android.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/android/tab_android.h" 11 #include "chrome/browser/android/tab_android.h"
12 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
13 #include "chrome/browser/history/top_sites.h" 13 #include "chrome/browser/history/top_sites.h"
14 #include "chrome/browser/history/top_sites_factory.h"
14 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
15 #include "chrome/browser/ui/android/tab_model/tab_model.h" 16 #include "chrome/browser/ui/android/tab_model/tab_model.h"
16 #include "chrome/browser/ui/android/tab_model/tab_model_list.h" 17 #include "chrome/browser/ui/android/tab_model/tab_model_list.h"
17 #include "content/public/browser/devtools_agent_host.h" 18 #include "content/public/browser/devtools_agent_host.h"
18 #include "content/public/browser/devtools_target.h" 19 #include "content/public/browser/devtools_target.h"
19 #include "content/public/browser/favicon_status.h" 20 #include "content/public/browser/favicon_status.h"
20 #include "content/public/browser/navigation_entry.h" 21 #include "content/public/browser/navigation_entry.h"
21 #include "content/public/browser/web_contents.h" 22 #include "content/public/browser/web_contents.h"
22 23
23 using content::DevToolsAgentHost; 24 using content::DevToolsAgentHost;
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 } 331 }
331 targets.push_back(new NonTabTarget(*it)); 332 targets.push_back(new NonTabTarget(*it));
332 } 333 }
333 334
334 callback.Run(targets); 335 callback.Run(targets);
335 } 336 }
336 337
337 std::string DevToolsManagerDelegateAndroid::GetPageThumbnailData( 338 std::string DevToolsManagerDelegateAndroid::GetPageThumbnailData(
338 const GURL& url) { 339 const GURL& url) {
339 Profile* profile = ProfileManager::GetLastUsedProfile()->GetOriginalProfile(); 340 Profile* profile = ProfileManager::GetLastUsedProfile()->GetOriginalProfile();
340 history::TopSites* top_sites = profile->GetTopSites(); 341 scoped_refptr<history::TopSites> top_sites =
342 TopSitesFactory::GetForProfile(profile);
341 if (top_sites) { 343 if (top_sites) {
342 scoped_refptr<base::RefCountedMemory> data; 344 scoped_refptr<base::RefCountedMemory> data;
343 if (top_sites->GetPageThumbnail(url, false, &data)) 345 if (top_sites->GetPageThumbnail(url, false, &data))
344 return std::string(data->front_as<char>(), data->size()); 346 return std::string(data->front_as<char>(), data->size());
345 } 347 }
346 return std::string(); 348 return std::string();
347 } 349 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/dev_tools_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698