Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7220)

Unified Diff: chrome/browser/ui/browser.cc

Issue 10534123: Revert 141723 - First pass at making Chrome support metro snap mode. It creates a fullscreen-alike … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
===================================================================
--- chrome/browser/ui/browser.cc (revision 141727)
+++ chrome/browser/ui/browser.cc (working copy)
@@ -191,7 +191,6 @@
#include "webkit/plugins/webplugininfo.h"
#if defined(OS_WIN)
-#include "base/win/metro.h"
#include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/ssl/ssl_error_info.h"
@@ -1294,16 +1293,7 @@
void Browser::WindowFullscreenStateChanged() {
fullscreen_controller_->WindowFullscreenStateChanged();
- FullScreenMode fullscreen_mode = FULLSCREEN_DISABLED;
- if (window_->IsFullscreen()) {
-#if defined(OS_WIN)
- fullscreen_mode = window_->IsInMetroSnapMode() ? FULLSCREEN_METRO_SNAP :
- FULLSCREEN_NORMAL;
-#else
- fullscreen_mode = FULLSCREEN_NORMAL;
-#endif
- }
- UpdateCommandsForFullscreenMode(fullscreen_mode);
+ UpdateCommandsForFullscreenMode(window_->IsFullscreen());
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN);
}
@@ -2511,10 +2501,6 @@
case IDC_COPY_URL: WriteCurrentURLToClipboard(); break;
case IDC_SHOW_AS_TAB: ConvertPopupToTabbedBrowser(); break;
case IDC_FULLSCREEN: ToggleFullscreenMode(); break;
-#if defined(OS_WIN)
- case IDC_METRO_SNAP_ENABLE: SetMetroSnapMode(true); break;
- case IDC_METRO_SNAP_DISABLE: SetMetroSnapMode(false); break;
-#endif
#if defined(OS_MACOSX)
case IDC_PRESENTATION_MODE: TogglePresentationMode(); break;
#endif
@@ -4173,11 +4159,6 @@
command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_6, normal_window);
command_updater_.UpdateCommandEnabled(IDC_SELECT_TAB_7, normal_window);
command_updater_.UpdateCommandEnabled(IDC_SELECT_LAST_TAB, normal_window);
-#if defined(OS_WIN)
- const bool metro_mode = (base::win::GetMetroModule() != NULL);
- command_updater_.UpdateCommandEnabled(IDC_METRO_SNAP_ENABLE, metro_mode);
- command_updater_.UpdateCommandEnabled(IDC_METRO_SNAP_DISABLE, metro_mode);
-#endif
#if defined(OS_MACOSX)
command_updater_.UpdateCommandEnabled(IDC_TABPOSE, normal_window);
command_updater_.UpdateCommandEnabled(IDC_PRESENTATION_MODE,
@@ -4209,7 +4190,7 @@
command_updater_.UpdateCommandEnabled(IDC_TOGGLE_SPEECH_INPUT, true);
// Initialize other commands whose state changes based on fullscreen mode.
- UpdateCommandsForFullscreenMode(FULLSCREEN_DISABLED);
+ UpdateCommandsForFullscreenMode(false);
UpdateCommandsForContentRestrictionState();
@@ -4349,18 +4330,16 @@
pref_service->SetBoolean(prefs::kHomePageChanged, true);
}
-void Browser::UpdateCommandsForFullscreenMode(FullScreenMode fullscreen_mode) {
- const bool show_main_ui =
- IsShowingMainUI(fullscreen_mode != FULLSCREEN_DISABLED);
- bool main_not_fullscreen = show_main_ui &&
- (fullscreen_mode == FULLSCREEN_DISABLED);
+void Browser::UpdateCommandsForFullscreenMode(bool is_fullscreen) {
+ const bool show_main_ui = IsShowingMainUI(is_fullscreen);
+ bool main_not_fullscreen = show_main_ui && !is_fullscreen;
// Navigation commands
command_updater_.UpdateCommandEnabled(IDC_OPEN_CURRENT_URL, show_main_ui);
// Window management commands
command_updater_.UpdateCommandEnabled(IDC_SHOW_AS_TAB,
- type_ != TYPE_TABBED && (fullscreen_mode == FULLSCREEN_DISABLED));
+ type_ != TYPE_TABBED && !is_fullscreen);
// Focus various bits of UI
command_updater_.UpdateCommandEnabled(IDC_FOCUS_TOOLBAR, show_main_ui);
@@ -4397,11 +4376,6 @@
command_updater_.UpdateCommandEnabled(IDC_PROFILING_ENABLED, show_main_ui);
#endif
- // Disable explicit fullscreen toggling when in metro snap mode.
- command_updater_.UpdateCommandEnabled(
- IDC_FULLSCREEN,
- fullscreen_mode != FULLSCREEN_METRO_SNAP);
-
UpdateCommandsForBookmarkBar();
UpdateCommandsForMultipleProfiles();
}
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698