| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/options/content_settings_window_view.h" | 5 #include "chrome/browser/views/options/content_settings_window_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/command_line.h" |
| 9 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/pref_service.h" | 11 #include "chrome/browser/pref_service.h" |
| 11 #include "chrome/browser/profile.h" | 12 #include "chrome/browser/profile.h" |
| 12 #include "chrome/browser/views/options/advanced_page_view.h" | 13 #include "chrome/browser/views/options/advanced_page_view.h" |
| 13 #include "chrome/browser/views/options/content_filter_page_view.h" | 14 #include "chrome/browser/views/options/content_filter_page_view.h" |
| 14 #include "chrome/browser/views/options/cookie_filter_page_view.h" | 15 #include "chrome/browser/views/options/cookie_filter_page_view.h" |
| 15 #include "chrome/browser/views/options/general_page_view.h" | 16 #include "chrome/browser/views/options/general_page_view.h" |
| 17 #include "chrome/browser/views/options/geolocation_filter_page_view.h" |
| 16 #include "chrome/common/chrome_constants.h" | 18 #include "chrome/common/chrome_constants.h" |
| 19 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/pref_names.h" | 20 #include "chrome/common/pref_names.h" |
| 18 #include "grit/chromium_strings.h" | 21 #include "grit/chromium_strings.h" |
| 19 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 20 #include "grit/locale_settings.h" | 23 #include "grit/locale_settings.h" |
| 21 #include "views/controls/tabbed_pane/tabbed_pane.h" | 24 #include "views/controls/tabbed_pane/tabbed_pane.h" |
| 22 #include "views/widget/root_view.h" | 25 #include "views/widget/root_view.h" |
| 23 #include "views/window/dialog_delegate.h" | 26 #include "views/window/dialog_delegate.h" |
| 24 #include "views/window/window.h" | 27 #include "views/window/window.h" |
| 25 | 28 |
| 26 static ContentSettingsWindowView* instance_ = NULL; | 29 static ContentSettingsWindowView* instance_ = NULL; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 new ContentFilterPageView(profile_, CONTENT_SETTINGS_TYPE_PLUGINS); | 164 new ContentFilterPageView(profile_, CONTENT_SETTINGS_TYPE_PLUGINS); |
| 162 tabs_->AddTabAtIndex(tab_index++, | 165 tabs_->AddTabAtIndex(tab_index++, |
| 163 l10n_util::GetString(IDS_PLUGIN_TAB_LABEL), | 166 l10n_util::GetString(IDS_PLUGIN_TAB_LABEL), |
| 164 plugin_page, false); | 167 plugin_page, false); |
| 165 | 168 |
| 166 ContentFilterPageView* popup_page = | 169 ContentFilterPageView* popup_page = |
| 167 new ContentFilterPageView(profile_, CONTENT_SETTINGS_TYPE_POPUPS); | 170 new ContentFilterPageView(profile_, CONTENT_SETTINGS_TYPE_POPUPS); |
| 168 tabs_->AddTabAtIndex(tab_index++, | 171 tabs_->AddTabAtIndex(tab_index++, |
| 169 l10n_util::GetString(IDS_POPUP_TAB_LABEL), | 172 l10n_util::GetString(IDS_POPUP_TAB_LABEL), |
| 170 popup_page, false); | 173 popup_page, false); |
| 171 | 174 int num_tabs = CONTENT_SETTINGS_NUM_TYPES - 1; |
| 172 DCHECK_EQ(tabs_->GetTabCount(), CONTENT_SETTINGS_NUM_TYPES); | 175 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 176 switches::kEnableGeolocation)) { |
| 177 GeolocationFilterPageView* geolocation_page = |
| 178 new GeolocationFilterPageView(profile_); |
| 179 tabs_->AddTabAtIndex(tab_index++, |
| 180 l10n_util::GetString(IDS_GEOLOCATION_TAB_LABEL), |
| 181 geolocation_page, false); |
| 182 ++num_tabs; |
| 183 } |
| 184 DCHECK_EQ(tabs_->GetTabCount(), num_tabs); |
| 173 } | 185 } |
| 174 | 186 |
| 175 const OptionsPageView* | 187 const OptionsPageView* |
| 176 ContentSettingsWindowView::GetCurrentContentSettingsTabView() const { | 188 ContentSettingsWindowView::GetCurrentContentSettingsTabView() const { |
| 177 return static_cast<OptionsPageView*>(tabs_->GetSelectedTab()); | 189 return static_cast<OptionsPageView*>(tabs_->GetSelectedTab()); |
| 178 } | 190 } |
| OLD | NEW |