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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 | 553 |
554 const Extension* extension = | 554 const Extension* extension = |
555 extension_service_->GetExtensionById(extension_id, true); | 555 extension_service_->GetExtensionById(extension_id, true); |
556 if (!extension) | 556 if (!extension) |
557 return; | 557 return; |
558 | 558 |
559 // Don't update the page; it already knows about the launch type change. | 559 // Don't update the page; it already knows about the launch type change. |
560 base::AutoReset<bool> auto_reset(&ignore_changes_, true); | 560 base::AutoReset<bool> auto_reset(&ignore_changes_, true); |
561 | 561 |
562 extensions::SetLaunchType( | 562 extensions::SetLaunchType( |
563 extension_service_->extension_prefs(), | 563 extension_service_, |
564 extension_id, | 564 extension_id, |
565 static_cast<extensions::LaunchType>( | 565 static_cast<extensions::LaunchType>(static_cast<int>(launch_type))); |
566 static_cast<int>(launch_type))); | |
567 } | 566 } |
568 | 567 |
569 void AppLauncherHandler::HandleUninstallApp(const ListValue* args) { | 568 void AppLauncherHandler::HandleUninstallApp(const ListValue* args) { |
570 std::string extension_id; | 569 std::string extension_id; |
571 CHECK(args->GetString(0, &extension_id)); | 570 CHECK(args->GetString(0, &extension_id)); |
572 | 571 |
573 const Extension* extension = extension_service_->GetInstalledExtension( | 572 const Extension* extension = extension_service_->GetInstalledExtension( |
574 extension_id); | 573 extension_id); |
575 if (!extension) | 574 if (!extension) |
576 return; | 575 return; |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { | 838 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { |
840 if (!extension_uninstall_dialog_.get()) { | 839 if (!extension_uninstall_dialog_.get()) { |
841 Browser* browser = chrome::FindBrowserWithWebContents( | 840 Browser* browser = chrome::FindBrowserWithWebContents( |
842 web_ui()->GetWebContents()); | 841 web_ui()->GetWebContents()); |
843 extension_uninstall_dialog_.reset( | 842 extension_uninstall_dialog_.reset( |
844 ExtensionUninstallDialog::Create(extension_service_->profile(), | 843 ExtensionUninstallDialog::Create(extension_service_->profile(), |
845 browser, this)); | 844 browser, this)); |
846 } | 845 } |
847 return extension_uninstall_dialog_.get(); | 846 return extension_uninstall_dialog_.get(); |
848 } | 847 } |
OLD | NEW |