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

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

Issue 93883004: Sync the launch type pref for apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test for invalid value, make tests actually check things Created 6 years, 11 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 <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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 const Extension* extension = 556 const Extension* extension =
557 extension_service_->GetExtensionById(extension_id, true); 557 extension_service_->GetExtensionById(extension_id, true);
558 if (!extension) 558 if (!extension)
559 return; 559 return;
560 560
561 // Don't update the page; it already knows about the launch type change. 561 // Don't update the page; it already knows about the launch type change.
562 base::AutoReset<bool> auto_reset(&ignore_changes_, true); 562 base::AutoReset<bool> auto_reset(&ignore_changes_, true);
563 563
564 extensions::SetLaunchType( 564 extensions::SetLaunchType(
565 extension_service_->extension_prefs(), 565 extension_service_,
566 extension_id, 566 extension_id,
567 static_cast<extensions::LaunchType>( 567 static_cast<extensions::LaunchType>(static_cast<int>(launch_type)));
568 static_cast<int>(launch_type)));
569 } 568 }
570 569
571 void AppLauncherHandler::HandleUninstallApp(const ListValue* args) { 570 void AppLauncherHandler::HandleUninstallApp(const ListValue* args) {
572 std::string extension_id; 571 std::string extension_id;
573 CHECK(args->GetString(0, &extension_id)); 572 CHECK(args->GetString(0, &extension_id));
574 573
575 const Extension* extension = extension_service_->GetInstalledExtension( 574 const Extension* extension = extension_service_->GetInstalledExtension(
576 extension_id); 575 extension_id);
577 if (!extension) 576 if (!extension)
578 return; 577 return;
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { 840 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() {
842 if (!extension_uninstall_dialog_.get()) { 841 if (!extension_uninstall_dialog_.get()) {
843 Browser* browser = chrome::FindBrowserWithWebContents( 842 Browser* browser = chrome::FindBrowserWithWebContents(
844 web_ui()->GetWebContents()); 843 web_ui()->GetWebContents());
845 extension_uninstall_dialog_.reset( 844 extension_uninstall_dialog_.reset(
846 ExtensionUninstallDialog::Create(extension_service_->profile(), 845 ExtensionUninstallDialog::Create(extension_service_->profile(),
847 browser, this)); 846 browser, this));
848 } 847 }
849 return extension_uninstall_dialog_.get(); 848 return extension_uninstall_dialog_.get();
850 } 849 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698