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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "apps/metrics_names.h" | 9 #include "apps/metrics_names.h" |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 | 561 |
562 const Extension* extension = | 562 const Extension* extension = |
563 extension_service_->GetExtensionById(extension_id, true); | 563 extension_service_->GetExtensionById(extension_id, true); |
564 if (!extension) | 564 if (!extension) |
565 return; | 565 return; |
566 | 566 |
567 // Don't update the page; it already knows about the launch type change. | 567 // Don't update the page; it already knows about the launch type change. |
568 base::AutoReset<bool> auto_reset(&ignore_changes_, true); | 568 base::AutoReset<bool> auto_reset(&ignore_changes_, true); |
569 | 569 |
570 extensions::SetLaunchType( | 570 extensions::SetLaunchType( |
571 extension_service_->extension_prefs(), | 571 extension_service_, |
572 extension_id, | 572 extension_id, |
573 static_cast<extensions::LaunchType>( | 573 static_cast<extensions::LaunchType>(static_cast<int>(launch_type))); |
574 static_cast<int>(launch_type))); | |
575 } | 574 } |
576 | 575 |
577 void AppLauncherHandler::HandleUninstallApp(const base::ListValue* args) { | 576 void AppLauncherHandler::HandleUninstallApp(const base::ListValue* args) { |
578 std::string extension_id; | 577 std::string extension_id; |
579 CHECK(args->GetString(0, &extension_id)); | 578 CHECK(args->GetString(0, &extension_id)); |
580 | 579 |
581 const Extension* extension = extension_service_->GetInstalledExtension( | 580 const Extension* extension = extension_service_->GetInstalledExtension( |
582 extension_id); | 581 extension_id); |
583 if (!extension) | 582 if (!extension) |
584 return; | 583 return; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { | 846 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { |
848 if (!extension_uninstall_dialog_.get()) { | 847 if (!extension_uninstall_dialog_.get()) { |
849 Browser* browser = chrome::FindBrowserWithWebContents( | 848 Browser* browser = chrome::FindBrowserWithWebContents( |
850 web_ui()->GetWebContents()); | 849 web_ui()->GetWebContents()); |
851 extension_uninstall_dialog_.reset( | 850 extension_uninstall_dialog_.reset( |
852 ExtensionUninstallDialog::Create(extension_service_->profile(), | 851 ExtensionUninstallDialog::Create(extension_service_->profile(), |
853 browser, this)); | 852 browser, this)); |
854 } | 853 } |
855 return extension_uninstall_dialog_.get(); | 854 return extension_uninstall_dialog_.get(); |
856 } | 855 } |
OLD | NEW |