summaryrefslogtreecommitdiffstats
path: root/win8
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 19:01:22 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-05 19:01:22 +0000
commit962efc3816ba36b7b9b8c301770e4a5cbcd8796e (patch)
tree57ceaa8ee69d3416d7d28809165879daaa26ed22 /win8
parent052305f5cbd3ecf7fcca4f427a3fdc19c747cd89 (diff)
downloadchromium_src-962efc3816ba36b7b9b8c301770e4a5cbcd8796e.zip
chromium_src-962efc3816ba36b7b9b8c301770e4a5cbcd8796e.tar.gz
chromium_src-962efc3816ba36b7b9b8c301770e4a5cbcd8796e.tar.bz2
If a new chrome window becomes visible while the current metro chrome window is snapped, the new window should be snapped.
Currently the new chrome window which becomes visible ends up with the wrong size when metro chrome is snapped. We should ensure that the new chrome window is also snapped and the IDC_METRO_SNAP_ENABLE message is sent to it. This ensures that the behavior remains consistent, i.e the omnibox remains invisible, etc. BUG=163458 R=robertshield Review URL: https://codereview.chromium.org/11442004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171265 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8')
-rw-r--r--win8/metro_driver/chrome_app_view.cc18
-rw-r--r--win8/metro_driver/chrome_app_view.h3
2 files changed, 20 insertions, 1 deletions
diff --git a/win8/metro_driver/chrome_app_view.cc b/win8/metro_driver/chrome_app_view.cc
index e487795..ffdd3b0 100644
--- a/win8/metro_driver/chrome_app_view.cc
+++ b/win8/metro_driver/chrome_app_view.cc
@@ -259,8 +259,17 @@ void SetFrameWindowInternal(HWND hwnd) {
globals.host_windows.push_front(std::make_pair(hwnd, window_scrolled_state));
- if (new_window)
+ if (new_window) {
AdjustFrameWindowStyleForMetro(hwnd);
+ } else {
+ DVLOG(1) << "Adjusting new top window to core window size";
+ AdjustToFitWindow(hwnd, 0);
+ }
+ if (globals.view->GetViewState() ==
+ winui::ViewManagement::ApplicationViewState_Snapped) {
+ DVLOG(1) << "Enabling Metro snap state on new window: " << hwnd;
+ ::PostMessageW(hwnd, WM_SYSCOMMAND, IDC_METRO_SNAP_ENABLE, 0);
+ }
}
void CloseFrameWindowInternal(HWND hwnd) {
@@ -406,6 +415,13 @@ void ChromeAppView::SetFullscreen(bool fullscreen) {
}
}
+winui::ViewManagement::ApplicationViewState ChromeAppView::GetViewState() {
+ winui::ViewManagement::ApplicationViewState view_state =
+ winui::ViewManagement::ApplicationViewState_FullScreenLandscape;
+ app_view_->get_Value(&view_state);
+ return view_state;
+}
+
void UnsnapHelper() {
ChromeAppView::Unsnap();
}
diff --git a/win8/metro_driver/chrome_app_view.h b/win8/metro_driver/chrome_app_view.h
index c52a96a..8c08176 100644
--- a/win8/metro_driver/chrome_app_view.h
+++ b/win8/metro_driver/chrome_app_view.h
@@ -71,6 +71,9 @@ class ChromeAppView
// Notification from chrome that a full screen operation is being performed.
void SetFullscreen(bool fullscreen);
+ // Returns the current view state of the chrome window.
+ winui::ViewManagement::ApplicationViewState GetViewState();
+
private:
HRESULT OnActivate(winapp::Core::ICoreApplicationView* view,
winapp::Activation::IActivatedEventArgs* args);