diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 16:57:41 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-21 16:57:41 +0000 |
commit | e5b826e46e8a435945f94370bd50bc7ee1749607 (patch) | |
tree | b971065c84b55f0dc3f44838bc6b6b021e51bffc /chrome | |
parent | 48fe9f38c0fa156a18b6f2d283076db20450321f (diff) | |
download | chromium_src-e5b826e46e8a435945f94370bd50bc7ee1749607.zip chromium_src-e5b826e46e8a435945f94370bd50bc7ee1749607.tar.gz chromium_src-e5b826e46e8a435945f94370bd50bc7ee1749607.tar.bz2 |
Removing IsChromeFrameProcess.
This further reduces Chrome's dependencies on the installer and fixes a problem where Chrome might pick up the "chrome_frame" variable from the master preferences file and all chrome processes might have assumed they were cf processes.
TEST=See description.
BUG=61609
Review URL: http://codereview.chromium.org/5973006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69837 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_main.cc | 3 | ||||
-rw-r--r-- | chrome/browser/notifications/notification_options_menu_model.cc | 5 | ||||
-rw-r--r-- | chrome/installer/util/browser_distribution.cc | 7 | ||||
-rw-r--r-- | chrome/installer/util/install_util.cc | 6 | ||||
-rw-r--r-- | chrome/installer/util/install_util.h | 6 | ||||
-rw-r--r-- | chrome/installer/util/master_preferences_dummy.cc | 3 |
6 files changed, 10 insertions, 20 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index cf4ee07..904c6e2 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -86,7 +86,6 @@ #include "chrome/common/pref_names.h" #include "chrome/common/result_codes.h" #include "chrome/installer/util/google_update_settings.h" -#include "chrome/installer/util/master_preferences.h" #include "grit/app_locale_settings.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" @@ -688,7 +687,7 @@ void InitializeBrokerServices(const MainFunctionParams& parameters, MetricsService* InitializeMetrics(const CommandLine& parsed_command_line, const PrefService* local_state) { #if defined(OS_WIN) - if (InstallUtil::IsChromeFrameProcess()) + if (parsed_command_line.HasSwitch(switches::kChromeFrame)) MetricsLog::set_version_extension("-F"); #elif defined(ARCH_CPU_64_BITS) MetricsLog::set_version_extension("-64"); diff --git a/chrome/browser/notifications/notification_options_menu_model.cc b/chrome/browser/notifications/notification_options_menu_model.cc index 4190dcd..45620c9 100644 --- a/chrome/browser/notifications/notification_options_menu_model.cc +++ b/chrome/browser/notifications/notification_options_menu_model.cc @@ -13,6 +13,7 @@ #include "chrome/browser/notifications/notification.h" #include "chrome/browser/notifications/notifications_prefs_cache.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/common/chrome_switches.h" #include "chrome/common/content_settings_types.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/url_constants.h" @@ -20,7 +21,6 @@ #if defined(OS_WIN) #include "chrome/browser/ui/views/browser_dialogs.h" -#include "chrome/installer/util/install_util.h" #endif // OS_WIN // Menu commands @@ -150,7 +150,8 @@ void NotificationOptionsMenuModel::ExecuteCommand(int command_id) { CONTENT_SETTINGS_TYPE_NOTIFICATIONS); } else { #if defined(OS_WIN) - if (InstallUtil::IsChromeFrameProcess()) { + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kChromeFrame)) { // We may not have a browser if this is a chrome frame process. browser::ShowContentSettingsWindow(NULL, CONTENT_SETTINGS_TYPE_DEFAULT, diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc index 2aa80b8..ba54e70 100644 --- a/chrome/installer/util/browser_distribution.cc +++ b/chrome/installer/util/browser_distribution.cc @@ -21,11 +21,13 @@ #include "chrome/installer/util/chrome_frame_distribution.h" #include "chrome/installer/util/google_chrome_distribution.h" #include "chrome/installer/util/google_chrome_sxs_distribution.h" -#include "chrome/installer/util/install_util.h" #include "chrome/installer/util/l10n_string_util.h" +#include "chrome/installer/util/master_preferences.h" #include "installer_util_strings.h" // NOLINT +using installer::MasterPreferences; + namespace { // The BrowserDistribution objects are never freed. BrowserDistribution* g_browser_distribution = NULL; @@ -50,7 +52,8 @@ bool IsCeeeBrokerProcess() { BrowserDistribution::Type GetCurrentDistributionType() { static BrowserDistribution::Type type = - (InstallUtil::IsChromeFrameProcess() || IsChromeFrameModule()) ? + (MasterPreferences::ForCurrentProcess().install_chrome_frame() || + IsChromeFrameModule()) ? BrowserDistribution::CHROME_FRAME : BrowserDistribution::CHROME_BROWSER; return type; diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc index c5384b3..6676bae 100644 --- a/chrome/installer/util/install_util.cc +++ b/chrome/installer/util/install_util.cc @@ -119,12 +119,6 @@ bool InstallUtil::IsPerUserInstall(const wchar_t* const exe_path) { return true; } -bool InstallUtil::IsChromeFrameProcess() { - const MasterPreferences& prefs = - installer::MasterPreferences::ForCurrentProcess(); - return prefs.install_chrome_frame(); -} - bool CheckIsChromeSxSProcess() { CommandLine* command_line = CommandLine::ForCurrentProcess(); CHECK(command_line); diff --git a/chrome/installer/util/install_util.h b/chrome/installer/util/install_util.h index 59a4fb5..b2ba973 100644 --- a/chrome/installer/util/install_util.h +++ b/chrome/installer/util/install_util.h @@ -59,12 +59,6 @@ class InstallUtil { // Program Files). static bool IsPerUserInstall(const wchar_t* const exe_path); - // Returns true if this is a Chrome Frame installation (as indicated by the - // presence of --chrome-frame on the command line) or if this is running - // inside of the Chrome Frame dll. Also returns true if a master.preferences - // file containing chrome_frame: true is specified on the command line. - static bool IsChromeFrameProcess(); - // Returns true if this is running setup process for Chrome SxS (as // indicated by the presence of --chrome-sxs on the command line) or if this // is running Chrome process from the Chrome SxS installation (as indicated diff --git a/chrome/installer/util/master_preferences_dummy.cc b/chrome/installer/util/master_preferences_dummy.cc index 0112bee..4869ac6 100644 --- a/chrome/installer/util/master_preferences_dummy.cc +++ b/chrome/installer/util/master_preferences_dummy.cc @@ -30,8 +30,7 @@ MasterPreferences::~MasterPreferences() { } bool MasterPreferences::GetBool(const std::string& name, bool* value) const { - // This function is called by InstallUtil::IsChromeFrameProcess() - // We return false because GetInstallPreferences returns an empty value below. + NOTREACHED(); return false; } |