From 7d1d20951e7de62096b76818d4c6de3c86786851 Mon Sep 17 00:00:00 2001 From: "tfarina@chromium.org" Date: Mon, 4 Mar 2013 04:12:43 +0000 Subject: apps: Stop depending on chrome_switches.h Instead move kShowAppListShortcut to a new apps_switches.h BUG=159366 R=benwells@chromium.org Review URL: https://chromiumcodereview.appspot.com/12391047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185833 0039d316-1c4b-4281-b951-d872f2087c98 --- apps/DEPS | 1 - apps/app_launcher.cc | 2 +- apps/apps.gypi | 2 ++ apps/switches.cc | 14 ++++++++++++++ apps/switches.h | 16 ++++++++++++++++ chrome/browser/about_flags.cc | 3 ++- .../api/webstore_private/webstore_private_api.cc | 4 ++-- .../browser/ui/views/app_list/app_list_controller_win.cc | 3 ++- chrome/common/chrome_switches.cc | 3 --- chrome/common/chrome_switches.h | 1 - 10 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 apps/switches.cc create mode 100644 apps/switches.h diff --git a/apps/DEPS b/apps/DEPS index 90a33a6..5de510e 100644 --- a/apps/DEPS +++ b/apps/DEPS @@ -8,7 +8,6 @@ include_rules = [ "+chrome/browser/profiles", "+chrome/browser/ui/host_desktop.h", "+chrome/common/chrome_notification_types.h", - "+chrome/common/chrome_switches.h", "+chrome/common/extensions", "+chrome/installer", ] diff --git a/apps/app_launcher.cc b/apps/app_launcher.cc index 7ad4578..b5c5fe9 100644 --- a/apps/app_launcher.cc +++ b/apps/app_launcher.cc @@ -5,13 +5,13 @@ #include "apps/app_launcher.h" #include "apps/pref_names.h" +#include "apps/switches.h" #include "base/command_line.h" #include "base/prefs/pref_registry_simple.h" #include "base/prefs/pref_service.h" #include "base/threading/sequenced_worker_pool.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/ui/host_desktop.h" -#include "chrome/common/chrome_switches.h" #include "content/public/browser/browser_thread.h" #if defined(OS_WIN) diff --git a/apps/apps.gypi b/apps/apps.gypi index 4bee420..7cd349b 100644 --- a/apps/apps.gypi +++ b/apps/apps.gypi @@ -32,6 +32,8 @@ 'pref_names.h', 'prefs.cc', 'prefs.h', + 'switches.cc', + 'switches.h', ], 'conditions': [ ['enable_extensions==0', { diff --git a/apps/switches.cc b/apps/switches.cc new file mode 100644 index 0000000..f5051c9 --- /dev/null +++ b/apps/switches.cc @@ -0,0 +1,14 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "apps/switches.h" + +namespace apps { +namespace switches { + +// If true an app list shortcut will be shown in the taskbar. +const char kShowAppListShortcut[] = "show-app-list-shortcut"; + +} // namespace switches +} // namespace apps diff --git a/apps/switches.h b/apps/switches.h new file mode 100644 index 0000000..c9ff965 --- /dev/null +++ b/apps/switches.h @@ -0,0 +1,16 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef APPS_SWITCHES_H_ +#define APPS_SWITCHES_H_ + +namespace apps { +namespace switches { + +extern const char kShowAppListShortcut[]; + +} // namespace switches +} // namespace apps + +#endif // APPS_SWITCHES_H_ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index d83a3fd..32af2c6 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -10,6 +10,7 @@ #include #include +#include "apps/switches.h" #include "base/command_line.h" #include "base/memory/singleton.h" #include "base/prefs/pref_service.h" @@ -1179,7 +1180,7 @@ const Experiment kExperiments[] = { IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_NAME, IDS_FLAGS_SHOW_APP_LIST_SHORTCUT_DESCRIPTION, kOsWin, - SINGLE_VALUE_TYPE(switches::kShowAppListShortcut) + SINGLE_VALUE_TYPE(apps::switches::kShowAppListShortcut) }, { "enable-experimental-form-filling", diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc index 0a9d05b..10e680f 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc @@ -5,6 +5,7 @@ #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" #include "apps/app_launcher.h" +#include "apps/switches.h" #include "base/bind_helpers.h" #include "base/command_line.h" #include "base/lazy_instance.h" @@ -31,7 +32,6 @@ #include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/ui/app_list/app_list_service.h" #include "chrome/common/chrome_notification_types.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_constants.h" #include "chrome/common/extensions/extension_l10n_util.h" @@ -455,7 +455,7 @@ bool CompleteInstallFunction::RunImpl() { } else { LOG(INFO) << "Enabling App Launcher via flags"; about_flags::SetExperimentEnabled(g_browser_process->local_state(), - switches::kShowAppListShortcut, + apps::switches::kShowAppListShortcut, true); } } diff --git a/chrome/browser/ui/views/app_list/app_list_controller_win.cc b/chrome/browser/ui/views/app_list/app_list_controller_win.cc index b2c6231..699e5e9 100644 --- a/chrome/browser/ui/views/app_list/app_list_controller_win.cc +++ b/chrome/browser/ui/views/app_list/app_list_controller_win.cc @@ -4,6 +4,7 @@ #include +#include "apps/switches.h" #include "base/command_line.h" #include "base/file_util.h" #include "base/lazy_instance.h" @@ -710,7 +711,7 @@ void CheckAppListTaskbarShortcutOnFileThread( .AddExtension(installer::kLnkExt)); const bool should_show = CommandLine::ForCurrentProcess()->HasSwitch( - switches::kShowAppListShortcut); + apps::switches::kShowAppListShortcut); // This will not reshow a shortcut if it has been unpinned manually by the // user, as that will not delete the shortcut file. diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 19fe39a..b85012e 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -1209,9 +1209,6 @@ const char kSetToken[] = "set-token"; // If true the app list will be shown. const char kShowAppList[] = "show-app-list"; -// If true an app list shortcut will be shown in the taskbar. -const char kShowAppListShortcut[] = "show-app-list-shortcut"; - // Annotates forms with Autofill field type predictions. const char kShowAutofillTypePredictions[] = "show-autofill-type-predictions"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index bd7ea64..75989fe 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -322,7 +322,6 @@ extern const char kSideloadWipeout[]; extern const char kSilentLaunch[]; extern const char kSetToken[]; extern const char kShowAppList[]; -extern const char kShowAppListShortcut[]; extern const char kShowAutofillTypePredictions[]; extern const char kShowComponentExtensionOptions[]; extern const char kShowIcons[]; -- cgit v1.1