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

Side by Side Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 10675007: Move each permission classes to its own files in extensions/permissions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase again Created 8 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 (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/ui/webui/ntp/app_launcher_handler.h" 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 value->SetInteger("launch_container", extension->launch_container()); 139 value->SetInteger("launch_container", extension->launch_container());
140 ExtensionPrefs* prefs = service->extension_prefs(); 140 ExtensionPrefs* prefs = service->extension_prefs();
141 value->SetInteger("launch_type", 141 value->SetInteger("launch_type",
142 prefs->GetLaunchType(extension->id(), 142 prefs->GetLaunchType(extension->id(),
143 ExtensionPrefs::LAUNCH_DEFAULT)); 143 ExtensionPrefs::LAUNCH_DEFAULT));
144 value->SetBoolean("is_component", 144 value->SetBoolean("is_component",
145 extension->location() == Extension::COMPONENT); 145 extension->location() == Extension::COMPONENT);
146 value->SetBoolean("is_webstore", 146 value->SetBoolean("is_webstore",
147 extension->id() == extension_misc::kWebStoreAppId); 147 extension->id() == extension_misc::kWebStoreAppId);
148 148
149 if (extension->HasAPIPermission(ExtensionAPIPermission::kAppNotifications)) { 149 if (extension->HasAPIPermission(
150 extensions::APIPermission::kAppNotifications)) {
150 value->SetBoolean("notifications_disabled", 151 value->SetBoolean("notifications_disabled",
151 prefs->IsAppNotificationDisabled(extension->id())); 152 prefs->IsAppNotificationDisabled(extension->id()));
152 } 153 }
153 154
154 if (notification) 155 if (notification)
155 value->Set("notification", SerializeNotification(*notification)); 156 value->Set("notification", SerializeNotification(*notification));
156 157
157 ExtensionSorting* sorting = prefs->extension_sorting(); 158 ExtensionSorting* sorting = prefs->extension_sorting();
158 StringOrdinal page_ordinal = sorting->GetPageOrdinal(extension->id()); 159 StringOrdinal page_ordinal = sorting->GetPageOrdinal(extension->id());
159 if (!page_ordinal.IsValid()) { 160 if (!page_ordinal.IsValid()) {
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 995
995 void AppLauncherHandler::UninstallDefaultApps() { 996 void AppLauncherHandler::UninstallDefaultApps() {
996 AppsPromo* apps_promo = extension_service_->apps_promo(); 997 AppsPromo* apps_promo = extension_service_->apps_promo();
997 const extensions::ExtensionIdSet& app_ids = apps_promo->old_default_apps(); 998 const extensions::ExtensionIdSet& app_ids = apps_promo->old_default_apps();
998 for (extensions::ExtensionIdSet::const_iterator iter = app_ids.begin(); 999 for (extensions::ExtensionIdSet::const_iterator iter = app_ids.begin();
999 iter != app_ids.end(); ++iter) { 1000 iter != app_ids.end(); ++iter) {
1000 if (extension_service_->GetExtensionById(*iter, true)) 1001 if (extension_service_->GetExtensionById(*iter, true))
1001 extension_service_->UninstallExtension(*iter, false, NULL); 1002 extension_service_->UninstallExtension(*iter, false, NULL);
1002 } 1003 }
1003 } 1004 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/extensions/shell_window.cc ('k') | chrome/browser/ui/webui/options2/content_settings_handler2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698