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

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: unfix nit because it prevents testing of how invalid values are handled 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_browsertest.cc ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698