| 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/sync/glue/session_model_associator.h" | 5 #include "chrome/browser/sync/glue/session_model_associator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); | 546 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); |
| 547 if (!favicon_service) | 547 if (!favicon_service) |
| 548 return; | 548 return; |
| 549 SessionID::id_type tab_id = tab_link->tab()->GetSessionId(); | 549 SessionID::id_type tab_id = tab_link->tab()->GetSessionId(); |
| 550 if (tab_link->favicon_load_handle()) { | 550 if (tab_link->favicon_load_handle()) { |
| 551 // We have an outstanding favicon load for this tab. Cancel it. | 551 // We have an outstanding favicon load for this tab. Cancel it. |
| 552 load_consumer_.CancelAllRequestsForClientData(tab_id); | 552 load_consumer_.CancelAllRequestsForClientData(tab_id); |
| 553 } | 553 } |
| 554 DVLOG(1) << "Triggering favicon load for url " << tab_link->url().spec(); | 554 DVLOG(1) << "Triggering favicon load for url " << tab_link->url().spec(); |
| 555 FaviconService::Handle handle = favicon_service->GetRawFaviconForURL( | 555 FaviconService::Handle handle = favicon_service->GetRawFaviconForURL( |
| 556 profile_, tab_link->url(), history::FAVICON, gfx::kFaviconSize, | 556 FaviconService::FaviconForURLParams(profile_, tab_link->url(), |
| 557 ui::SCALE_FACTOR_100P, &load_consumer_, | 557 history::FAVICON, gfx::kFaviconSize, &load_consumer_), |
| 558 ui::SCALE_FACTOR_100P, |
| 558 base::Bind(&SessionModelAssociator::OnFaviconDataAvailable, | 559 base::Bind(&SessionModelAssociator::OnFaviconDataAvailable, |
| 559 AsWeakPtr())); | 560 AsWeakPtr())); |
| 560 load_consumer_.SetClientData(favicon_service, handle, tab_id); | 561 load_consumer_.SetClientData(favicon_service, handle, tab_id); |
| 561 tab_link->set_favicon_load_handle(handle); | 562 tab_link->set_favicon_load_handle(handle); |
| 562 } | 563 } |
| 563 | 564 |
| 564 void SessionModelAssociator::OnFaviconDataAvailable( | 565 void SessionModelAssociator::OnFaviconDataAvailable( |
| 565 FaviconService::Handle handle, | 566 FaviconService::Handle handle, |
| 566 const history::FaviconBitmapResult& bitmap_result) { | 567 const history::FaviconBitmapResult& bitmap_result) { |
| 567 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 568 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| (...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1596 | 1597 |
| 1597 bool SessionModelAssociator::CryptoReadyIfNecessary() { | 1598 bool SessionModelAssociator::CryptoReadyIfNecessary() { |
| 1598 // We only access the cryptographer while holding a transaction. | 1599 // We only access the cryptographer while holding a transaction. |
| 1599 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); | 1600 syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); |
| 1600 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); | 1601 const syncer::ModelTypeSet encrypted_types = trans.GetEncryptedTypes(); |
| 1601 return !encrypted_types.Has(SESSIONS) || | 1602 return !encrypted_types.Has(SESSIONS) || |
| 1602 sync_service_->IsCryptographerReady(&trans); | 1603 sync_service_->IsCryptographerReady(&trans); |
| 1603 } | 1604 } |
| 1604 | 1605 |
| 1605 } // namespace browser_sync | 1606 } // namespace browser_sync |
| OLD | NEW |