| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/sync/glue/bookmark_change_processor.h" | 4 #include "chrome/browser/sync/glue/bookmark_change_processor.h" |
| 5 | 5 |
| 6 #include <stack> | 6 #include <stack> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 GURL fake_icon_url = bookmark_node->GetURL(); | 534 GURL fake_icon_url = bookmark_node->GetURL(); |
| 535 | 535 |
| 536 HistoryService* history = | 536 HistoryService* history = |
| 537 profile->GetHistoryService(Profile::EXPLICIT_ACCESS); | 537 profile->GetHistoryService(Profile::EXPLICIT_ACCESS); |
| 538 FaviconService* favicon_service = | 538 FaviconService* favicon_service = |
| 539 profile->GetFaviconService(Profile::EXPLICIT_ACCESS); | 539 profile->GetFaviconService(Profile::EXPLICIT_ACCESS); |
| 540 | 540 |
| 541 history->AddPage(bookmark_node->GetURL(), history::SOURCE_SYNCED); | 541 history->AddPage(bookmark_node->GetURL(), history::SOURCE_SYNCED); |
| 542 favicon_service->SetFavicon(bookmark_node->GetURL(), | 542 favicon_service->SetFavicon(bookmark_node->GetURL(), |
| 543 fake_icon_url, | 543 fake_icon_url, |
| 544 icon_bytes_vector); | 544 icon_bytes_vector, |
| 545 history::FAVICON); |
| 545 } | 546 } |
| 546 | 547 |
| 547 // static | 548 // static |
| 548 void BookmarkChangeProcessor::SetSyncNodeFavicon( | 549 void BookmarkChangeProcessor::SetSyncNodeFavicon( |
| 549 const BookmarkNode* bookmark_node, | 550 const BookmarkNode* bookmark_node, |
| 550 BookmarkModel* model, | 551 BookmarkModel* model, |
| 551 sync_api::WriteNode* sync_node) { | 552 sync_api::WriteNode* sync_node) { |
| 552 std::vector<unsigned char> favicon_bytes; | 553 std::vector<unsigned char> favicon_bytes; |
| 553 EncodeFavicon(bookmark_node, model, &favicon_bytes); | 554 EncodeFavicon(bookmark_node, model, &favicon_bytes); |
| 554 if (!favicon_bytes.empty()) | 555 if (!favicon_bytes.empty()) |
| 555 sync_node->SetFaviconBytes(favicon_bytes); | 556 sync_node->SetFaviconBytes(favicon_bytes); |
| 556 } | 557 } |
| 557 | 558 |
| 558 } // namespace browser_sync | 559 } // namespace browser_sync |
| OLD | NEW |