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

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

Issue 10630021: Modify experimental identity flow to display scope descriptions and details. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
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 929 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 // Do the re-enable work here. 940 // Do the re-enable work here.
941 DCHECK(!extension_id_prompting_.empty()); 941 DCHECK(!extension_id_prompting_.empty());
942 942
943 // The extension can be uninstalled in another window while the UI was 943 // The extension can be uninstalled in another window while the UI was
944 // showing. Do nothing in that case. 944 // showing. Do nothing in that case.
945 const Extension* extension = 945 const Extension* extension =
946 extension_service_->GetExtensionById(extension_id_prompting_, true); 946 extension_service_->GetExtensionById(extension_id_prompting_, true);
947 if (!extension) 947 if (!extension)
948 return; 948 return;
949 949
950 extension_service_->GrantPermissionsAndEnableExtension(extension); 950 extension_service_->GrantPermissionsAndEnableExtension(
951 extension, extension_install_ui_->record_oauth2_grant());
951 952
952 // We bounce this off the NTP so the browser can update the apps icon. 953 // We bounce this off the NTP so the browser can update the apps icon.
953 // If we don't launch the app asynchronously, then the app's disabled 954 // If we don't launch the app asynchronously, then the app's disabled
954 // icon disappears but isn't replaced by the enabled icon, making a poor 955 // icon disappears but isn't replaced by the enabled icon, making a poor
955 // visual experience. 956 // visual experience.
956 StringValue app_id(extension->id()); 957 StringValue app_id(extension->id());
957 web_ui()->CallJavascriptFunction("ntp.launchAppAfterEnable", app_id); 958 web_ui()->CallJavascriptFunction("ntp.launchAppAfterEnable", app_id);
958 959
959 extension_id_prompting_ = ""; 960 extension_id_prompting_ = "";
960 } 961 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 993
993 void AppLauncherHandler::UninstallDefaultApps() { 994 void AppLauncherHandler::UninstallDefaultApps() {
994 AppsPromo* apps_promo = extension_service_->apps_promo(); 995 AppsPromo* apps_promo = extension_service_->apps_promo();
995 const extensions::ExtensionIdSet& app_ids = apps_promo->old_default_apps(); 996 const extensions::ExtensionIdSet& app_ids = apps_promo->old_default_apps();
996 for (extensions::ExtensionIdSet::const_iterator iter = app_ids.begin(); 997 for (extensions::ExtensionIdSet::const_iterator iter = app_ids.begin();
997 iter != app_ids.end(); ++iter) { 998 iter != app_ids.end(); ++iter) {
998 if (extension_service_->GetExtensionById(*iter, true)) 999 if (extension_service_->GetExtensionById(*iter, true))
999 extension_service_->UninstallExtension(*iter, false, NULL); 1000 extension_service_->UninstallExtension(*iter, false, NULL);
1000 } 1001 }
1001 } 1002 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698