| 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 GURL fake_icon_url = bookmark_node->GetURL(); | 532 GURL fake_icon_url = bookmark_node->GetURL(); |
| 533 | 533 |
| 534 HistoryService* history = | 534 HistoryService* history = |
| 535 profile->GetHistoryService(Profile::EXPLICIT_ACCESS); | 535 profile->GetHistoryService(Profile::EXPLICIT_ACCESS); |
| 536 FaviconService* favicon_service = | 536 FaviconService* favicon_service = |
| 537 profile->GetFaviconService(Profile::EXPLICIT_ACCESS); | 537 profile->GetFaviconService(Profile::EXPLICIT_ACCESS); |
| 538 | 538 |
| 539 history->AddPage(bookmark_node->GetURL(), history::SOURCE_SYNCED); | 539 history->AddPage(bookmark_node->GetURL(), history::SOURCE_SYNCED); |
| 540 favicon_service->SetFavicon(bookmark_node->GetURL(), | 540 favicon_service->SetFavicon(bookmark_node->GetURL(), |
| 541 fake_icon_url, | 541 fake_icon_url, |
| 542 icon_bytes_vector); | 542 icon_bytes_vector, |
| 543 history::FAV_ICON); |
| 543 } | 544 } |
| 544 | 545 |
| 545 // static | 546 // static |
| 546 void BookmarkChangeProcessor::SetSyncNodeFavicon( | 547 void BookmarkChangeProcessor::SetSyncNodeFavicon( |
| 547 const BookmarkNode* bookmark_node, | 548 const BookmarkNode* bookmark_node, |
| 548 BookmarkModel* model, | 549 BookmarkModel* model, |
| 549 sync_api::WriteNode* sync_node) { | 550 sync_api::WriteNode* sync_node) { |
| 550 std::vector<unsigned char> favicon_bytes; | 551 std::vector<unsigned char> favicon_bytes; |
| 551 EncodeFavicon(bookmark_node, model, &favicon_bytes); | 552 EncodeFavicon(bookmark_node, model, &favicon_bytes); |
| 552 if (!favicon_bytes.empty()) | 553 if (!favicon_bytes.empty()) |
| 553 sync_node->SetFaviconBytes(favicon_bytes); | 554 sync_node->SetFaviconBytes(favicon_bytes); |
| 554 } | 555 } |
| 555 | 556 |
| 556 } // namespace browser_sync | 557 } // namespace browser_sync |
| OLD | NEW |