| Index: chrome/browser/ui/browser.cc
|
| ===================================================================
|
| --- chrome/browser/ui/browser.cc (revision 84869)
|
| +++ chrome/browser/ui/browser.cc (working copy)
|
| @@ -264,12 +264,22 @@
|
| encoding_auto_detect_.Init(prefs::kWebKitUsesUniversalDetector,
|
| profile_->GetPrefs(), NULL);
|
| use_vertical_tabs_.Init(prefs::kUseVerticalTabs, profile_->GetPrefs(), this);
|
| + use_compact_navigation_bar_.Init(prefs::kUseCompactNavigationBar,
|
| + profile_->GetPrefs(),
|
| + this);
|
|
|
| if (!TabMenuModel::AreVerticalTabsEnabled()) {
|
| // If vertical tabs aren't enabled, explicitly turn them off. Otherwise we
|
| // might show vertical tabs but not show an option to turn them off.
|
| use_vertical_tabs_.SetValue(false);
|
| }
|
| + if (!TabMenuModel::IsCompactNavigationModeEnabled()) {
|
| + // If the compact navigation bar isn't enabled, explicitly turn it off.
|
| + // Otherwise we might show the compact navigation bar but not show an option
|
| + // to turn it off.
|
| + use_compact_navigation_bar_.SetValue(false);
|
| + }
|
| +
|
| UpdateTabStripModelInsertionPolicy();
|
|
|
| tab_restore_service_ = TabRestoreServiceFactory::GetForProfile(profile);
|
| @@ -328,6 +338,7 @@
|
|
|
| encoding_auto_detect_.Destroy();
|
| use_vertical_tabs_.Destroy();
|
| + use_compact_navigation_bar_.Destroy();
|
|
|
| if (profile_->IsOffTheRecord() &&
|
| !BrowserList::IsOffTheRecordSessionActive()) {
|
| @@ -427,6 +438,11 @@
|
| Source<Browser>(this),
|
| NotificationService::NoDetails());
|
|
|
| + if (use_compact_navigation_bar_.GetValue()) {
|
| + // This enables the compact navigation bar host.
|
| + UseCompactNavigationBarChanged();
|
| + }
|
| +
|
| // Show the First Run information bubble if we've been told to.
|
| PrefService* local_state = g_browser_process->local_state();
|
| if (!local_state)
|
| @@ -1216,6 +1232,7 @@
|
| command_updater_.UpdateCommandEnabled(IDC_ABOUT, show_main_ui);
|
| command_updater_.UpdateCommandEnabled(IDC_SHOW_APP_MENU, show_main_ui);
|
| command_updater_.UpdateCommandEnabled(IDC_TOGGLE_VERTICAL_TABS, show_main_ui);
|
| + command_updater_.UpdateCommandEnabled(IDC_COMPACT_NAVBAR, show_main_ui);
|
| #if defined (ENABLE_PROFILING) && !defined(NO_TCMALLOC)
|
| command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui);
|
| #endif
|
| @@ -1253,6 +1270,10 @@
|
| window()->ToggleTabStripMode();
|
| }
|
|
|
| +void Browser::UseCompactNavigationBarChanged() {
|
| + window_->ToggleUseCompactNavigationBar();
|
| +}
|
| +
|
| bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
|
| bool check_fullscreen) const {
|
| // On Mac, fullscreen mode has most normal things (in a slide-down panel). On
|
| @@ -2150,6 +2171,9 @@
|
| prefs->RegisterBooleanPref(prefs::kUseVerticalTabs,
|
| false,
|
| PrefService::UNSYNCABLE_PREF);
|
| + prefs->RegisterBooleanPref(prefs::kUseCompactNavigationBar,
|
| + false,
|
| + PrefService::UNSYNCABLE_PREF);
|
| prefs->RegisterBooleanPref(prefs::kEnableTranslate,
|
| true,
|
| PrefService::SYNCABLE_PREF);
|
| @@ -2299,6 +2323,7 @@
|
| case IDC_FULLSCREEN: ToggleFullscreenMode(); break;
|
| case IDC_EXIT: Exit(); break;
|
| case IDC_TOGGLE_VERTICAL_TABS: ToggleUseVerticalTabs(); break;
|
| + case IDC_COMPACT_NAVBAR: ToggleUseCompactNavigationBar(); break;
|
| #if defined(OS_CHROMEOS)
|
| case IDC_SEARCH: Search(); break;
|
| case IDC_SHOW_KEYBOARD_OVERLAY: ShowKeyboardOverlay(); break;
|
| @@ -2774,6 +2799,11 @@
|
| UseVerticalTabsChanged();
|
| }
|
|
|
| +void Browser::ToggleUseCompactNavigationBar() {
|
| + use_compact_navigation_bar_.SetValue(!UseCompactNavigationBar());
|
| + UseCompactNavigationBarChanged();
|
| +}
|
| +
|
| bool Browser::LargeIconsPermitted() const {
|
| // We don't show the big icons in tabs for TYPE_EXTENSION_APP windows because
|
| // for those windows, we already have a big icon in the top-left outside any
|
| @@ -3158,6 +3188,10 @@
|
| return use_vertical_tabs_.GetValue();
|
| }
|
|
|
| +bool Browser::UseCompactNavigationBar() const {
|
| + return use_compact_navigation_bar_.GetValue();
|
| +}
|
| +
|
| void Browser::ContentsZoomChange(bool zoom_in) {
|
| ExecuteCommand(zoom_in ? IDC_ZOOM_PLUS : IDC_ZOOM_MINUS);
|
| }
|
| @@ -3555,6 +3589,8 @@
|
| const std::string& pref_name = *Details<std::string>(details).ptr();
|
| if (pref_name == prefs::kUseVerticalTabs) {
|
| UseVerticalTabsChanged();
|
| + } else if (pref_name == prefs::kUseCompactNavigationBar) {
|
| + UseCompactNavigationBarChanged();
|
| } else if (pref_name == prefs::kPrintingEnabled) {
|
| UpdatePrintingState(GetContentRestrictionsForSelectedTab());
|
| } else if (pref_name == prefs::kInstantEnabled) {
|
|
|