| OLD | NEW |
| 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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 extension_uninstall_dialog_.reset( | 982 extension_uninstall_dialog_.reset( |
| 983 ExtensionUninstallDialog::Create(browser, this)); | 983 ExtensionUninstallDialog::Create(browser, this)); |
| 984 } | 984 } |
| 985 return extension_uninstall_dialog_.get(); | 985 return extension_uninstall_dialog_.get(); |
| 986 } | 986 } |
| 987 | 987 |
| 988 ExtensionInstallPrompt* AppLauncherHandler::GetExtensionInstallPrompt() { | 988 ExtensionInstallPrompt* AppLauncherHandler::GetExtensionInstallPrompt() { |
| 989 if (!extension_install_ui_.get()) { | 989 if (!extension_install_ui_.get()) { |
| 990 Browser* browser = browser::FindBrowserWithWebContents( | 990 Browser* browser = browser::FindBrowserWithWebContents( |
| 991 web_ui()->GetWebContents()); | 991 web_ui()->GetWebContents()); |
| 992 extension_install_ui_.reset(new ExtensionInstallPrompt(browser)); | 992 extension_install_ui_.reset( |
| 993 chrome::CreateExtensionInstallPromptWithBrowser(browser)); |
| 993 } | 994 } |
| 994 return extension_install_ui_.get(); | 995 return extension_install_ui_.get(); |
| 995 } | 996 } |
| 996 | 997 |
| 997 void AppLauncherHandler::UninstallDefaultApps() { | 998 void AppLauncherHandler::UninstallDefaultApps() { |
| 998 AppsPromo* apps_promo = extension_service_->apps_promo(); | 999 AppsPromo* apps_promo = extension_service_->apps_promo(); |
| 999 const extensions::ExtensionIdSet& app_ids = apps_promo->old_default_apps(); | 1000 const extensions::ExtensionIdSet& app_ids = apps_promo->old_default_apps(); |
| 1000 for (extensions::ExtensionIdSet::const_iterator iter = app_ids.begin(); | 1001 for (extensions::ExtensionIdSet::const_iterator iter = app_ids.begin(); |
| 1001 iter != app_ids.end(); ++iter) { | 1002 iter != app_ids.end(); ++iter) { |
| 1002 if (extension_service_->GetExtensionById(*iter, true)) | 1003 if (extension_service_->GetExtensionById(*iter, true)) |
| 1003 extension_service_->UninstallExtension(*iter, false, NULL); | 1004 extension_service_->UninstallExtension(*iter, false, NULL); |
| 1004 } | 1005 } |
| 1005 } | 1006 } |
| OLD | NEW |