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

Side by Side Diff: chrome/browser/extensions/extension_sync_service.cc

Issue 1066623008: Sync bookmark app icon urls and sizes, and download icons for new apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated sync value conversions Created 5 years, 7 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
« no previous file with comments | « chrome/browser/extensions/convert_web_app.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extensions/extension_sync_service.h" 5 #include "chrome/browser/extensions/extension_sync_service.h"
6 6
7 #include <iterator> 7 #include <iterator>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 web_app_info.app_url = bookmark_app_url; 411 web_app_info.app_url = bookmark_app_url;
412 web_app_info.title = 412 web_app_info.title =
413 base::UTF8ToUTF16(app_sync_data.extension_sync_data().name()); 413 base::UTF8ToUTF16(app_sync_data.extension_sync_data().name());
414 web_app_info.description = 414 web_app_info.description =
415 base::UTF8ToUTF16(app_sync_data.bookmark_app_description()); 415 base::UTF8ToUTF16(app_sync_data.bookmark_app_description());
416 if (!app_sync_data.bookmark_app_icon_color().empty()) { 416 if (!app_sync_data.bookmark_app_icon_color().empty()) {
417 extensions::image_util::ParseCSSColorString( 417 extensions::image_util::ParseCSSColorString(
418 app_sync_data.bookmark_app_icon_color(), 418 app_sync_data.bookmark_app_icon_color(),
419 &web_app_info.generated_icon_color); 419 &web_app_info.generated_icon_color);
420 } 420 }
421 for (const auto& icon : app_sync_data.linked_icons()) {
422 WebApplicationInfo::IconInfo icon_info;
423 icon_info.url = icon.url;
424 icon_info.width = icon.size;
425 icon_info.height = icon.size;
426 web_app_info.icons.push_back(icon_info);
427 }
421 428
422 // If the bookmark app already exists, keep the old icons. 429 // If the bookmark app already exists, keep the old icons.
423 if (!extension) { 430 if (!extension) {
424 CreateOrUpdateBookmarkApp(extension_service_, &web_app_info); 431 CreateOrUpdateBookmarkApp(extension_service_, &web_app_info);
425 } else { 432 } else {
426 app_sync_data.extension_sync_data().name(); 433 app_sync_data.extension_sync_data().name();
427 GetWebApplicationInfoFromApp(profile_, 434 GetWebApplicationInfoFromApp(profile_,
428 extension, 435 extension,
429 base::Bind(&OnWebApplicationInfoLoaded, 436 base::Bind(&OnWebApplicationInfoLoaded,
430 web_app_info, 437 web_app_info,
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 app_sync_bundle_.SyncChangeIfNeeded(extension); 589 app_sync_bundle_.SyncChangeIfNeeded(extension);
583 else if (extension_service_->is_ready() && !flare_.is_null()) 590 else if (extension_service_->is_ready() && !flare_.is_null())
584 flare_.Run(syncer::APPS); 591 flare_.Run(syncer::APPS);
585 } else if (extensions::util::ShouldSyncExtension(&extension, profile_)) { 592 } else if (extensions::util::ShouldSyncExtension(&extension, profile_)) {
586 if (extension_sync_bundle_.IsSyncing()) 593 if (extension_sync_bundle_.IsSyncing())
587 extension_sync_bundle_.SyncChangeIfNeeded(extension); 594 extension_sync_bundle_.SyncChangeIfNeeded(extension);
588 else if (extension_service_->is_ready() && !flare_.is_null()) 595 else if (extension_service_->is_ready() && !flare_.is_null())
589 flare_.Run(syncer::EXTENSIONS); 596 flare_.Run(syncer::EXTENSIONS);
590 } 597 }
591 } 598 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/convert_web_app.cc ('k') | chrome/chrome_common.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698