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

Unified Diff: chrome/browser/ui/app_list/app_context_menu.cc

Issue 489313002: Centralize command line checks for kEnableStreamlinedHostedApps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/browser/ui/app_list/extension_app_item.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/app_context_menu.cc
diff --git a/chrome/browser/ui/app_list/app_context_menu.cc b/chrome/browser/ui/app_list/app_context_menu.cc
index 36ad563f6ebb944c514d664770a300270ca9a780..a5a67269926657f2f9129ecdbd928a30b57f77b4 100644
--- a/chrome/browser/ui/app_list/app_context_menu.cc
+++ b/chrome/browser/ui/app_list/app_context_menu.cc
@@ -5,14 +5,13 @@
#include "chrome/browser/ui/app_list/app_context_menu.h"
#include "base/bind.h"
-#include "base/command_line.h"
#include "chrome/browser/extensions/context_menu_matcher.h"
+#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/menu_manager.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/app_context_menu_delegate.h"
#include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/manifest_url_handler.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
@@ -118,8 +117,7 @@ ui::MenuModel* AppContextMenu::GetMenuModel() {
if (!is_platform_app_) {
// Streamlined hosted apps can only toggle between USE_LAUNCH_TYPE_WINDOW
// and USE_LAUNCH_TYPE_REGULAR.
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableStreamlinedHostedApps)) {
+ if (extensions::util::IsStreamlinedHostedAppsEnabled()) {
menu_model_->AddCheckItemWithStringId(
USE_LAUNCH_TYPE_REGULAR,
IDS_APP_CONTEXT_MENU_OPEN_TAB);
@@ -264,8 +262,7 @@ void AppContextMenu::ExecuteCommand(int command_id, int event_flags) {
command_id - USE_LAUNCH_TYPE_COMMAND_START);
// Streamlined hosted apps can only toggle between LAUNCH_TYPE_WINDOW and
// LAUNCH_TYPE_REGULAR.
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableStreamlinedHostedApps)) {
+ if (extensions::util::IsStreamlinedHostedAppsEnabled()) {
launch_type = (controller_->GetExtensionLaunchType(profile_, app_id_) ==
extensions::LAUNCH_TYPE_REGULAR) ?
extensions::LAUNCH_TYPE_WINDOW :
« no previous file with comments | « chrome/browser/extensions/tab_helper.cc ('k') | chrome/browser/ui/app_list/extension_app_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698