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

Side by Side Diff: chrome/browser/ui/app_list/app_list_syncable_service.cc

Issue 284103002: Replace "external_install" boolean parameter with explicit enumeration in ExtensionUninstall method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address code review feedback. Created 6 years, 5 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
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/ui/app_list/app_list_syncable_service.h" 5 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/apps/drive/drive_app_provider.h" 8 #include "chrome/browser/apps/drive/drive_app_provider.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 specifics); 93 specifics);
94 } 94 }
95 95
96 bool AppIsDefault(ExtensionService* service, const std::string& id) { 96 bool AppIsDefault(ExtensionService* service, const std::string& id) {
97 return service && extensions::ExtensionPrefs::Get(service->profile()) 97 return service && extensions::ExtensionPrefs::Get(service->profile())
98 ->WasInstalledByDefault(id); 98 ->WasInstalledByDefault(id);
99 } 99 }
100 100
101 void UninstallExtension(ExtensionService* service, const std::string& id) { 101 void UninstallExtension(ExtensionService* service, const std::string& id) {
102 if (service && service->GetInstalledExtension(id)) 102 if (service && service->GetInstalledExtension(id))
103 service->UninstallExtension(id, false, NULL); 103 service->UninstallExtension(
104 id, ExtensionService::UNINSTALL_REASON_SYNC, NULL);
104 } 105 }
105 106
106 bool GetAppListItemType(AppListItem* item, 107 bool GetAppListItemType(AppListItem* item,
107 sync_pb::AppListSpecifics::AppListItemType* type) { 108 sync_pb::AppListSpecifics::AppListItemType* type) {
108 const char* item_type = item->GetItemType(); 109 const char* item_type = item->GetItemType();
109 if (item_type == ExtensionAppItem::kItemType) { 110 if (item_type == ExtensionAppItem::kItemType) {
110 *type = sync_pb::AppListSpecifics::TYPE_APP; 111 *type = sync_pb::AppListSpecifics::TYPE_APP;
111 } else if (item_type == AppListFolderItem::kItemType) { 112 } else if (item_type == AppListFolderItem::kItemType) {
112 *type = sync_pb::AppListSpecifics::TYPE_FOLDER; 113 *type = sync_pb::AppListSpecifics::TYPE_FOLDER;
113 } else { 114 } else {
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 } else { 819 } else {
819 res += " { " + item_name + " }"; 820 res += " { " + item_name + " }";
820 res += " [" + item_ordinal.ToDebugString() + "]"; 821 res += " [" + item_ordinal.ToDebugString() + "]";
821 if (!parent_id.empty()) 822 if (!parent_id.empty())
822 res += " <" + parent_id.substr(0, 8) + ">"; 823 res += " <" + parent_id.substr(0, 8) + ">";
823 } 824 }
824 return res; 825 return res;
825 } 826 }
826 827
827 } // namespace app_list 828 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698