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

Side by Side Diff: chrome/browser/ui/webui/session_favicon_source.cc

Issue 13945023: Make URLDataSource::GetSource() const. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And another one. Created 7 years, 8 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/ui/webui/session_favicon_source.h" 5 #include "chrome/browser/ui/webui/session_favicon_source.h"
6 6
7 #include "chrome/browser/sync/glue/session_model_associator.h" 7 #include "chrome/browser/sync/glue/session_model_associator.h"
8 #include "chrome/browser/sync/profile_sync_service_factory.h" 8 #include "chrome/browser/sync/profile_sync_service_factory.h"
9 #include "chrome/browser/sync/profile_sync_service.h" 9 #include "chrome/browser/sync/profile_sync_service.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
11 11
12 using browser_sync::SessionModelAssociator; 12 using browser_sync::SessionModelAssociator;
13 13
14 SessionFaviconSource::SessionFaviconSource(Profile* profile) 14 SessionFaviconSource::SessionFaviconSource(Profile* profile)
15 : FaviconSource(profile, FaviconSource::FAVICON) { 15 : FaviconSource(profile, FaviconSource::FAVICON) {
16 } 16 }
17 17
18 SessionFaviconSource::~SessionFaviconSource() { 18 SessionFaviconSource::~SessionFaviconSource() {
19 } 19 }
20 20
21 std::string SessionFaviconSource::GetSource() { 21 std::string SessionFaviconSource::GetSource() const {
22 return chrome::kChromeUISessionFaviconHost; 22 return chrome::kChromeUISessionFaviconHost;
23 } 23 }
24 24
25 std::string SessionFaviconSource::GetMimeType(const std::string&) const { 25 std::string SessionFaviconSource::GetMimeType(const std::string&) const {
26 return "image/png"; 26 return "image/png";
27 } 27 }
28 28
29 bool SessionFaviconSource::ShouldReplaceExistingSource() const { 29 bool SessionFaviconSource::ShouldReplaceExistingSource() const {
30 // Leave the existing DataSource in place, otherwise we'll drop any pending 30 // Leave the existing DataSource in place, otherwise we'll drop any pending
31 // requests on the floor. 31 // requests on the floor.
(...skipping 14 matching lines...) Expand all
46 46
47 scoped_refptr<base::RefCountedMemory> response; 47 scoped_refptr<base::RefCountedMemory> response;
48 if (associator && 48 if (associator &&
49 associator->GetSyncedFaviconForPageURL(request.request_path, 49 associator->GetSyncedFaviconForPageURL(request.request_path,
50 &response)) { 50 &response)) {
51 request.callback.Run(response); 51 request.callback.Run(response);
52 return true; 52 return true;
53 } 53 }
54 return false; 54 return false;
55 } 55 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/session_favicon_source.h ('k') | chrome/browser/ui/webui/theme_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698