summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/chrome_command_ids.h2
-rw-r--r--chrome/browser/ui/browser.cc38
-rw-r--r--chrome/browser/ui/browser.h22
-rw-r--r--chrome/browser/ui/browser_win.cc7
-rw-r--r--chrome/browser/ui/browser_window.h8
-rw-r--r--chrome/browser/ui/fullscreen_controller.cc12
-rw-r--r--chrome/browser/ui/fullscreen_controller.h10
-rw-r--r--chrome/browser/ui/panels/panel_browser_window.cc11
-rw-r--r--chrome/browser/ui/panels/panel_browser_window.h4
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc40
-rw-r--r--chrome/browser/ui/views/frame/browser_view.h10
-rw-r--r--chrome/test/base/test_browser_window.cc6
-rw-r--r--chrome/test/base/test_browser_window.h4
-rw-r--r--ui/views/widget/native_widget_win.cc72
-rw-r--r--ui/views/widget/native_widget_win.h22
15 files changed, 31 insertions, 237 deletions
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h
index 7322ef8..89a0883 100644
--- a/chrome/app/chrome_command_ids.h
+++ b/chrome/app/chrome_command_ids.h
@@ -59,8 +59,6 @@
#define IDC_TABPOSE 34036
#define IDC_DEBUG_FRAME_TOGGLE 34038
#define IDC_PRESENTATION_MODE 34039
-#define IDC_METRO_SNAP_ENABLE 34040
-#define IDC_METRO_SNAP_DISABLE 34041
// Page-related commands
#define IDC_BOOKMARK_PAGE 35000
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index ad082ef..dfdd730 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -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 @@ browser::NavigateParams Browser::GetSingletonTabNavigateParams(
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 @@ void Browser::ExecuteCommandWithDisposition(
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 @@ void Browser::InitCommandState() {
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 @@ void Browser::InitCommandState() {
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 @@ void Browser::MarkHomePageAsChanged(PrefService* pref_service) {
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 @@ void Browser::UpdateCommandsForFullscreenMode(FullScreenMode fullscreen_mode) {
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();
}
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 4682c84..fcc3915 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -551,10 +551,6 @@ class Browser : public TabStripModelDelegate,
// See the description of
// FullscreenController::ToggleFullscreenModeWithExtension.
void ToggleFullscreenModeWithExtension(const GURL& extension_url);
-#if defined(OS_WIN)
- // See the description of FullscreenController::ToggleMetroSnapMode.
- void SetMetroSnapMode(bool enable);
-#endif
#if defined(OS_MACOSX)
void TogglePresentationMode();
#endif
@@ -908,18 +904,6 @@ class Browser : public TabStripModelDelegate,
BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN,
};
- enum FullScreenMode {
- // Not in fullscreen mode.
- FULLSCREEN_DISABLED,
-
- // Fullscreen mode, occupying the whole screen.
- FULLSCREEN_NORMAL,
-
- // Fullscreen mode for metro snap, occupying the full height and 20% of
- // the screen width.
- FULLSCREEN_METRO_SNAP,
- };
-
// Overridden from content::WebContentsDelegate:
virtual content::WebContents* OpenURLFromTab(
content::WebContents* source,
@@ -1127,9 +1111,9 @@ class Browser : public TabStripModelDelegate,
// Set the preference that indicates that the home page has been changed.
void MarkHomePageAsChanged(PrefService* pref_service);
- // Update commands whose state depends on the type of fullscreen mode the
- // window is in.
- void UpdateCommandsForFullscreenMode(FullScreenMode fullscreen_mode);
+ // Update commands whose state depends on whether the window is in fullscreen
+ // mode.
+ void UpdateCommandsForFullscreenMode(bool is_fullscreen);
// Update commands whose state depends on whether multiple profiles are
// allowed.
diff --git a/chrome/browser/ui/browser_win.cc b/chrome/browser/ui/browser_win.cc
index 1dc24d4..eb1e2f6 100644
--- a/chrome/browser/ui/browser_win.cc
+++ b/chrome/browser/ui/browser_win.cc
@@ -9,8 +9,7 @@
#include "chrome/browser/bookmarks/bookmark_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/fullscreen_controller.h"
-#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/browser/ui/tab_contents/tab_contents.h"
namespace {
@@ -54,10 +53,6 @@ void Browser::NewIncognitoWindow() {
NewEmptyWindow(profile_->GetOffTheRecordProfile());
}
-void Browser::SetMetroSnapMode(bool enable) {
- fullscreen_controller_->SetMetroSnapMode(enable);
-}
-
void Browser::PinCurrentPageToStartScreen() {
HMODULE metro_module = base::win::GetMetroModule();
if (metro_module) {
diff --git a/chrome/browser/ui/browser_window.h b/chrome/browser/ui/browser_window.h
index 9672c65..743a3cc 100644
--- a/chrome/browser/ui/browser_window.h
+++ b/chrome/browser/ui/browser_window.h
@@ -150,14 +150,6 @@ class BrowserWindow : public BaseWindow {
// Returns true if the fullscreen bubble is visible.
virtual bool IsFullscreenBubbleVisible() const = 0;
-#if defined(OS_WIN)
- // Sets state for entering or exiting Win8 Metro snap mode.
- virtual void SetMetroSnapMode(bool enable) = 0;
-
- // Returns whether the window is currently in Win8 Metro snap mode.
- virtual bool IsInMetroSnapMode() const = 0;
-#endif
-
// Returns the location bar.
virtual LocationBar* GetLocationBar() const = 0;
diff --git a/chrome/browser/ui/fullscreen_controller.cc b/chrome/browser/ui/fullscreen_controller.cc
index b875328..72c3ec2 100644
--- a/chrome/browser/ui/fullscreen_controller.cc
+++ b/chrome/browser/ui/fullscreen_controller.cc
@@ -58,12 +58,6 @@ bool FullscreenController::IsFullscreenForTabOrPending(
return true;
}
-#if defined(OS_WIN)
-bool FullscreenController::IsInMetroSnapMode() {
- return window_->IsInMetroSnapMode();
-}
-#endif
-
bool FullscreenController::IsMouseLockRequested() const {
return mouse_lock_state_ == MOUSELOCK_REQUESTED;
}
@@ -176,12 +170,6 @@ void FullscreenController::ToggleFullscreenModeForTab(WebContents* web_contents,
}
}
-#if defined(OS_WIN)
-void FullscreenController::SetMetroSnapMode(bool enable) {
- window_->SetMetroSnapMode(enable);
-}
-#endif
-
#if defined(OS_MACOSX)
void FullscreenController::TogglePresentationMode() {
TogglePresentationModeInternal(false);
diff --git a/chrome/browser/ui/fullscreen_controller.h b/chrome/browser/ui/fullscreen_controller.h
index 281622f..b47ec5e 100644
--- a/chrome/browser/ui/fullscreen_controller.h
+++ b/chrome/browser/ui/fullscreen_controller.h
@@ -51,11 +51,6 @@ class FullscreenController : public base::RefCounted<FullscreenController> {
bool IsFullscreenForTabOrPending(
const content::WebContents* web_contents) const;
-#if defined(OS_WIN)
- // Returns whether we are currently in a Metro snap view.
- bool IsInMetroSnapMode();
-#endif
-
bool IsMouseLockRequested() const;
bool IsMouseLocked() const;
@@ -65,11 +60,6 @@ class FullscreenController : public base::RefCounted<FullscreenController> {
bool last_unlocked_by_target);
void ToggleFullscreenModeForTab(content::WebContents* web_contents,
bool enter_fullscreen);
-#if defined(OS_WIN)
- // API that puts the window into a mode suitable for rendering when Chrome
- // is rendered in a 20% screen-width Metro snap view on Windows 8.
- void SetMetroSnapMode(bool enable);
-#endif
#if defined(OS_MACOSX)
void TogglePresentationMode();
#endif
diff --git a/chrome/browser/ui/panels/panel_browser_window.cc b/chrome/browser/ui/panels/panel_browser_window.cc
index d4c4141..fee6deb 100644
--- a/chrome/browser/ui/panels/panel_browser_window.cc
+++ b/chrome/browser/ui/panels/panel_browser_window.cc
@@ -183,17 +183,6 @@ void PanelBrowserWindow::ExitFullscreen() {
NOTIMPLEMENTED();
}
-#if defined(OS_WIN)
-void PanelBrowserWindow::SetMetroSnapMode(bool enable) {
- NOTIMPLEMENTED();
-}
-
-bool PanelBrowserWindow::IsInMetroSnapMode() const {
- NOTIMPLEMENTED();
- return false;
-}
-#endif
-
void PanelBrowserWindow::UpdateFullscreenExitBubbleContent(
const GURL& url,
FullscreenExitBubbleType bubble_type) {
diff --git a/chrome/browser/ui/panels/panel_browser_window.h b/chrome/browser/ui/panels/panel_browser_window.h
index 946bfea..59ec377 100644
--- a/chrome/browser/ui/panels/panel_browser_window.h
+++ b/chrome/browser/ui/panels/panel_browser_window.h
@@ -68,10 +68,6 @@ class PanelBrowserWindow : public BrowserWindow,
virtual void EnterFullscreen(
const GURL& url, FullscreenExitBubbleType type) OVERRIDE;
virtual void ExitFullscreen() OVERRIDE;
-#if defined(OS_WIN)
- virtual void SetMetroSnapMode(bool enable) OVERRIDE;
- virtual bool IsInMetroSnapMode() const OVERRIDE;
-#endif
virtual void UpdateFullscreenExitBubbleContent(
const GURL& url,
FullscreenExitBubbleType bubble_type) OVERRIDE;
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index c6c0de1..e840de3 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -770,14 +770,14 @@ void BrowserView::EnterFullscreen(
if (IsFullscreen())
return; // Nothing to do.
- ProcessFullscreen(true, FOR_DESKTOP, url, bubble_type);
+ ProcessFullscreen(true, url, bubble_type);
}
void BrowserView::ExitFullscreen() {
if (!IsFullscreen())
return; // Nothing to do.
- ProcessFullscreen(false, FOR_DESKTOP, GURL(), FEB_TYPE_NONE);
+ ProcessFullscreen(false, GURL(), FEB_TYPE_NONE);
}
void BrowserView::UpdateFullscreenExitBubbleContent(
@@ -805,29 +805,17 @@ void BrowserView::FullScreenStateChanged() {
if (IsFullscreen()) {
if (fullscreen_request_.pending) {
fullscreen_request_.pending = false;
- ProcessFullscreen(true, FOR_DESKTOP,
- fullscreen_request_.url,
+ ProcessFullscreen(true, fullscreen_request_.url,
fullscreen_request_.bubble_type);
} else {
- ProcessFullscreen(true, FOR_DESKTOP, GURL(),
+ ProcessFullscreen(true, GURL(),
FEB_TYPE_BROWSER_FULLSCREEN_EXIT_INSTRUCTION);
}
} else {
- ProcessFullscreen(false, FOR_DESKTOP, GURL(), FEB_TYPE_NONE);
+ ProcessFullscreen(false, GURL(), FEB_TYPE_NONE);
}
}
-#if defined(OS_WIN)
-void BrowserView::SetMetroSnapMode(bool enable) {
- ProcessFullscreen(enable, FOR_METRO, GURL(), FEB_TYPE_NONE);
-}
-
-bool BrowserView::IsInMetroSnapMode() const {
- return static_cast<views::NativeWidgetWin*>(
- frame_->native_widget())->IsInMetroSnapMode();
-}
-#endif // defined(OS_WIN)
-
void BrowserView::RestoreFocus() {
WebContents* selected_web_contents = GetActiveWebContents();
if (selected_web_contents)
@@ -2098,7 +2086,6 @@ bool BrowserView::UpdateChildViewAndLayout(views::View* new_view,
}
void BrowserView::ProcessFullscreen(bool fullscreen,
- FullscreenType type,
const GURL& url,
FullscreenExitBubbleType bubble_type) {
// Reduce jankiness during the following position changes by:
@@ -2111,8 +2098,7 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
OmniboxViewWin* omnibox_view =
static_cast<OmniboxViewWin*>(location_bar->GetLocationEntry());
#endif
-
- if (!fullscreen && type != FOR_METRO) {
+ if (!fullscreen) {
// Hide the fullscreen bubble as soon as possible, since the mode toggle can
// take enough time for the user to notice.
fullscreen_bubble_.reset();
@@ -2139,23 +2125,15 @@ void BrowserView::ProcessFullscreen(bool fullscreen,
PushForceHidden();
#endif
- if (type == FOR_METRO) {
-#if defined(OS_WIN)
- // Enter metro snap mode.
- static_cast<views::NativeWidgetWin*>(
- frame_->native_widget())->SetMetroSnapFullscreen(fullscreen);
-#endif
- } else {
- // Toggle fullscreen mode.
- frame_->SetFullscreen(fullscreen);
- }
+ // Toggle fullscreen mode.
+ frame_->SetFullscreen(fullscreen);
browser_->WindowFullscreenStateChanged();
if (fullscreen) {
bool is_kiosk =
CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode);
- if (!is_kiosk && type != FOR_METRO) {
+ if (!is_kiosk) {
fullscreen_bubble_.reset(new FullscreenExitBubbleViews(
GetWidget(), browser_.get(), url, bubble_type));
}
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index d25c96b..8c00ef0 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -254,10 +254,6 @@ class BrowserView : public BrowserWindow,
const GURL& url,
FullscreenExitBubbleType bubble_type) OVERRIDE;
virtual bool IsFullscreen() const OVERRIDE;
-#if defined(OS_WIN)
- virtual void SetMetroSnapMode(bool enable) OVERRIDE;
- virtual bool IsInMetroSnapMode() const OVERRIDE;
-#endif
virtual LocationBar* GetLocationBar() const OVERRIDE;
virtual void SetFocusToLocationBar(bool select_all) OVERRIDE;
virtual void UpdateReloadStopState(bool is_loading, bool force) OVERRIDE;
@@ -447,11 +443,6 @@ class BrowserView : public BrowserWindow,
FRIEND_TEST_ALL_PREFIXES(BrowserViewsAccessibilityTest,
TestAboutChromeViewAccObj);
- enum FullscreenType {
- FOR_DESKTOP,
- FOR_METRO
- };
-
// We store this on linux because we must call ProcessFullscreen()
// asynchronously from FullScreenStateChanged() instead of directly from
// EnterFullscreen().
@@ -515,7 +506,6 @@ class BrowserView : public BrowserWindow,
// |bubble_type| determines what should be shown in the fullscreen exit
// bubble.
void ProcessFullscreen(bool fullscreen,
- FullscreenType fullscreen_type,
const GURL& url,
FullscreenExitBubbleType bubble_type);
diff --git a/chrome/test/base/test_browser_window.cc b/chrome/test/base/test_browser_window.cc
index a09b8e8..6440afe 100644
--- a/chrome/test/base/test_browser_window.cc
+++ b/chrome/test/base/test_browser_window.cc
@@ -52,12 +52,6 @@ bool TestBrowserWindow::IsFullscreen() const {
return false;
}
-#if defined(OS_WIN)
-bool TestBrowserWindow::IsInMetroSnapMode() const {
- return false;
-}
-#endif
-
bool TestBrowserWindow::IsFullscreenBubbleVisible() const {
return false;
}
diff --git a/chrome/test/base/test_browser_window.h b/chrome/test/base/test_browser_window.h
index 40bfe81..a1a841a 100644
--- a/chrome/test/base/test_browser_window.h
+++ b/chrome/test/base/test_browser_window.h
@@ -62,10 +62,6 @@ class TestBrowserWindow : public BrowserWindow {
const GURL& url,
FullscreenExitBubbleType bubble_type) OVERRIDE {}
virtual bool IsFullscreen() const OVERRIDE;
-#if defined(OS_WIN)
- virtual void SetMetroSnapMode(bool enable) OVERRIDE {}
- virtual bool IsInMetroSnapMode() const;
-#endif
virtual bool IsFullscreenBubbleVisible() const OVERRIDE;
virtual LocationBar* GetLocationBar() const OVERRIDE;
virtual void SetFocusToLocationBar(bool select_all) OVERRIDE {}
diff --git a/ui/views/widget/native_widget_win.cc b/ui/views/widget/native_widget_win.cc
index b143228..d7a98f0 100644
--- a/ui/views/widget/native_widget_win.cc
+++ b/ui/views/widget/native_widget_win.cc
@@ -422,7 +422,6 @@ NativeWidgetWin::NativeWidgetWin(internal::NativeWidgetDelegate* delegate)
accessibility_view_events_(kMaxAccessibilityViewEvents),
previous_cursor_(NULL),
fullscreen_(false),
- metro_snap_(false),
force_hidden_count_(0),
lock_updates_count_(0),
ignore_window_pos_changes_(false),
@@ -991,40 +990,7 @@ void NativeWidgetWin::Restore() {
void NativeWidgetWin::SetFullscreen(bool fullscreen) {
if (fullscreen_ == fullscreen)
- return;
-
- gfx::Rect window_rect;
- if (fullscreen) {
- MONITORINFO monitor_info;
- monitor_info.cbSize = sizeof(monitor_info);
- GetMonitorInfo(MonitorFromWindow(GetNativeView(), MONITOR_DEFAULTTONEAREST),
- &monitor_info);
- window_rect = monitor_info.rcMonitor;
- }
-
- SetFullscreenInternal(fullscreen, window_rect);
-}
-
-void NativeWidgetWin::SetMetroSnapFullscreen(bool metro_snap) {
- if (metro_snap_ == metro_snap)
- return;
-
- metro_snap_ = metro_snap;
-
- gfx::Rect window_rect;
- if (!metro_snap) {
- MONITORINFO monitor_info;
- monitor_info.cbSize = sizeof(monitor_info);
- GetMonitorInfo(MonitorFromWindow(GetNativeView(), MONITOR_DEFAULTTONEAREST),
- &monitor_info);
- window_rect = monitor_info.rcMonitor;
- }
-
- SetFullscreenInternal(metro_snap, window_rect);
-}
-
-void NativeWidgetWin::SetFullscreenInternal(bool fullscreen,
- const gfx::Rect& window_rect) {
+ return; // Nothing to do.
// Reduce jankiness during the following position changes by hiding the window
// until it's in the final position.
@@ -1047,35 +1013,26 @@ void NativeWidgetWin::SetFullscreenInternal(bool fullscreen,
if (fullscreen_) {
// Set new window style and size.
+ MONITORINFO monitor_info;
+ monitor_info.cbSize = sizeof(monitor_info);
+ GetMonitorInfo(MonitorFromWindow(GetNativeView(), MONITOR_DEFAULTTONEAREST),
+ &monitor_info);
+ gfx::Rect monitor_rect(monitor_info.rcMonitor);
SetWindowLong(GWL_STYLE,
saved_window_info_.style & ~(WS_CAPTION | WS_THICKFRAME));
SetWindowLong(GWL_EXSTYLE,
saved_window_info_.ex_style & ~(WS_EX_DLGMODALFRAME |
WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE));
-
- // On expand, if we're given a window_rect, grow to it, otherwise do
- // not resize.
- if (window_rect.width() > 0) {
- SetWindowPos(NULL, window_rect.x(), window_rect.y(),
- window_rect.width(), window_rect.height(),
- SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
- }
+ SetWindowPos(NULL, monitor_rect.x(), monitor_rect.y(),
+ monitor_rect.width(), monitor_rect.height(),
+ SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
} else {
// Reset original window style and size. The multiple window size/moves
// here are ugly, but if SetWindowPos() doesn't redraw, the taskbar won't be
// repainted. Better-looking methods welcome.
+ gfx::Rect new_rect(saved_window_info_.window_rect);
SetWindowLong(GWL_STYLE, saved_window_info_.style);
SetWindowLong(GWL_EXSTYLE, saved_window_info_.ex_style);
-
- // On restore, if we're given a window_rect resize to that, otherwise
- // resize to the previous saved rect size.
- gfx::Rect new_rect;
- if (window_rect.width() > 0) {
- new_rect = window_rect;
- } else {
- new_rect = saved_window_info_.window_rect;
- }
-
SetWindowPos(NULL, new_rect.x(), new_rect.y(), new_rect.width(),
new_rect.height(),
SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);
@@ -1091,10 +1048,6 @@ bool NativeWidgetWin::IsFullscreen() const {
return fullscreen_;
}
-bool NativeWidgetWin::IsInMetroSnapMode() const {
- return metro_snap_;
-}
-
void NativeWidgetWin::SetOpacity(unsigned char opacity) {
layered_alpha_ = static_cast<BYTE>(opacity);
GetWidget()->GetRootView()->SchedulePaint();
@@ -2154,10 +2107,9 @@ void NativeWidgetWin::OnWindowPosChanging(WINDOWPOS* window_pos) {
gfx::Rect monitor_rect, work_area;
if (GetWindowRect(&window_rect) &&
GetMonitorAndRects(window_rect, &monitor, &monitor_rect, &work_area)) {
- bool work_area_changed = (monitor_rect == last_monitor_rect_) &&
- (work_area != last_work_area_);
if (monitor && (monitor == last_monitor_) &&
- ((IsFullscreen() && !metro_snap_) || work_area_changed)) {
+ (IsFullscreen() || ((monitor_rect == last_monitor_rect_) &&
+ (work_area != last_work_area_)))) {
// A rect for the monitor we're on changed. Normally Windows notifies
// us about this (and thus we're reaching here due to the SetWindowPos()
// call in OnSettingChange() above), but with some software (e.g.
diff --git a/ui/views/widget/native_widget_win.h b/ui/views/widget/native_widget_win.h
index 868c24b..d584390 100644
--- a/ui/views/widget/native_widget_win.h
+++ b/ui/views/widget/native_widget_win.h
@@ -115,13 +115,6 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl,
// the top of the stack. See PushForceHidden.
void PopForceHidden();
- // Places the window in a pseudo-fullscreen mode where it looks and acts as
- // like a fullscreen window except that it remains within the boundaries
- // of the metro snap divider.
- void SetMetroSnapFullscreen(bool metro_snap);
-
- bool IsInMetroSnapMode() const;
-
BOOL IsWindow() const {
return ::IsWindow(GetNativeView());
}
@@ -538,18 +531,6 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl,
// Overridden from internal::InputMethodDelegate
virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE;
- // Common implementation of fullscreen-related code. This method handles
- // changing from windowed mode to a display mode (dubbed fullscreen mode)
- // where the window occupies a fixed portion (possibly 100%) of the screen.
- // |fullscreen| specifies whether we are entering or leaving fullscreen mode.
- // |window_rect| contains sizing information that describes the portion of the
- // screen to be occupied. |window_rect| may be a rect of width
- // 0, which indicates that sizing should be skipped when
- // entering fullscreen mode and previously-stored size should
- // be used when exiting fullscreen mode.
- void SetFullscreenInternal(bool fullscreen,
- const gfx::Rect& window_rect);
-
// A delegate implementation that handles events received here.
// See class documentation for Widget in widget.h for a note about ownership.
internal::NativeWidgetDelegate* delegate_;
@@ -631,9 +612,6 @@ class VIEWS_EXPORT NativeWidgetWin : public ui::WindowImpl,
// True if we're in fullscreen mode.
bool fullscreen_;
- // True if we're in metro snap mode.
- bool metro_snap_;
-
// If this is greater than zero, we should prevent attempts to make the window
// visible when we handle WM_WINDOWPOSCHANGING. Some calls like
// ShowWindow(SW_RESTORE) make the window visible in addition to restoring it,