| OLD | NEW |
| 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" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 bool SessionFaviconSource::HandleMissingResource(const IconRequest& request) { | 41 bool SessionFaviconSource::HandleMissingResource(const IconRequest& request) { |
| 42 ProfileSyncService* sync_service = | 42 ProfileSyncService* sync_service = |
| 43 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_); | 43 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_); |
| 44 SessionModelAssociator* associator = sync_service ? | 44 SessionModelAssociator* associator = sync_service ? |
| 45 sync_service->GetSessionModelAssociator() : NULL; | 45 sync_service->GetSessionModelAssociator() : NULL; |
| 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.spec(), | 49 associator->GetSyncedFaviconForPageURL(request.request_path.spec(), |
| 50 &response)) { | 50 &response)) { |
| 51 request.callback.Run(response); | 51 request.callback.Run(response.get()); |
| 52 return true; | 52 return true; |
| 53 } | 53 } |
| 54 return false; | 54 return false; |
| 55 } | 55 } |
| OLD | NEW |