diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-30 18:32:32 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-30 18:32:32 +0000 |
commit | 67d0144c05b5bc8be1c38c80964e12525a3edac3 (patch) | |
tree | 0708b1019fb23c4be7099cb4970a54899576f273 | |
parent | 88a112d4d61dde540bb270a23367cf6786b1480b (diff) | |
download | chromium_src-67d0144c05b5bc8be1c38c80964e12525a3edac3.zip chromium_src-67d0144c05b5bc8be1c38c80964e12525a3edac3.tar.gz chromium_src-67d0144c05b5bc8be1c38c80964e12525a3edac3.tar.bz2 |
Revert 43111 - Make the location content setting tab be dependent on the enablegeolocation switch
BUG=39806
TEST=run browser with and without the enablegeolocation flag, and open the content settings page. (restart browser when Location tab was selected as current tab)
Review URL: http://codereview.chromium.org/1575005
TBR=joth@chromium.org
Review URL: http://codereview.chromium.org/1540006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43116 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/cocoa/content_settings_dialog_controller.mm | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/chrome/browser/cocoa/content_settings_dialog_controller.mm b/chrome/browser/cocoa/content_settings_dialog_controller.mm index a8b7869..b1786e8 100644 --- a/chrome/browser/cocoa/content_settings_dialog_controller.mm +++ b/chrome/browser/cocoa/content_settings_dialog_controller.mm @@ -7,7 +7,6 @@ #import <Cocoa/Cocoa.h> #include "app/l10n_util.h" -#include "base/command_line.h" #include "base/mac_util.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_window.h" @@ -17,7 +16,6 @@ #import "chrome/browser/host_content_settings_map.h" #include "chrome/browser/pref_service.h" #include "chrome/browser/profile.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" @@ -44,14 +42,6 @@ const NSInteger kGeolocationEnabledIndex = 0; const NSInteger kGeolocationAskIndex = 1; const NSInteger kGeolocationDisabledIndex = 2; -int ExpectedNumberOfTabs() { - if (!CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableGeolocation)) - return CONTENT_SETTINGS_NUM_TYPES - 1; - else - return CONTENT_SETTINGS_NUM_TYPES; -} - } // namespace @@ -116,7 +106,7 @@ class PrefObserverBridge : public NotificationObserver { if (settingsType == CONTENT_SETTINGS_TYPE_DEFAULT) { // Remember the last visited page from local state. int value = g_instance->lastSelectedTab_.GetValue(); - if (value >= 0 && value < ExpectedNumberOfTabs()) + if (value >= 0 && value < CONTENT_SETTINGS_NUM_TYPES) settingsType = static_cast<ContentSettingsType>(value); if (settingsType == CONTENT_SETTINGS_TYPE_DEFAULT) settingsType = CONTENT_SETTINGS_TYPE_COOKIES; @@ -151,14 +141,6 @@ class PrefObserverBridge : public NotificationObserver { - (void)awakeFromNib { DCHECK([self window]); DCHECK_EQ(self, [[self window] delegate]); - if (!CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableGeolocation)) { - NSTabViewItem* geolocation_tab = - [tabView_ tabViewItemAtIndex:CONTENT_SETTINGS_TYPE_GEOLOCATION]; - DCHECK(geolocation_tab); - [tabView_ removeTabViewItem:geolocation_tab]; - } - DCHECK_EQ(ExpectedNumberOfTabs(), [tabView_ numberOfTabViewItems]); } // NSWindowDelegate method. @@ -179,8 +161,9 @@ class PrefObserverBridge : public NotificationObserver { DCHECK_EQ(tabView_, tabView); NSInteger index = [tabView indexOfTabViewItem:tabViewItem]; DCHECK_GT(index, CONTENT_SETTINGS_TYPE_DEFAULT); - DCHECK_LT(index, ExpectedNumberOfTabs()); - if (index > CONTENT_SETTINGS_TYPE_DEFAULT && index < ExpectedNumberOfTabs()) + DCHECK_LT(index, CONTENT_SETTINGS_NUM_TYPES); + if (index > CONTENT_SETTINGS_TYPE_DEFAULT && + index < CONTENT_SETTINGS_NUM_TYPES) lastSelectedTab_.SetValue(index); } |