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

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

Issue 55303006: Make sure the non browser/non app widget is fully visible when created on ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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/views/chrome_views_delegate.h ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/chrome_views_delegate.cc
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc
index 785a6a0fde5c1a6d0b9434d99369c270a6bb0170..2f121754bcfaeb5577343a004d1e331d8f12546f 100644
--- a/chrome/browser/ui/views/chrome_views_delegate.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -39,6 +39,7 @@
#if defined(USE_ASH)
#include "ash/shell.h"
+#include "ash/wm/window_state.h"
#include "chrome/browser/ui/ash/ash_init.h"
#include "chrome/browser/ui/ash/ash_util.h"
#endif
@@ -92,6 +93,7 @@ void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window,
}
bool ChromeViewsDelegate::GetSavedWindowPlacement(
+ const views::Widget* widget,
const std::string& window_name,
gfx::Rect* bounds,
ui::WindowShowState* show_state) const {
@@ -115,6 +117,18 @@ bool ChromeViewsDelegate::GetSavedWindowPlacement(
dictionary->GetBoolean("maximized", &maximized);
*show_state = maximized ? ui::SHOW_STATE_MAXIMIZED : ui::SHOW_STATE_NORMAL;
+#if defined(USE_ASH)
+ // On Ash environment, a window won't span across displays. Adjust
+ // the bounds to fit the work area.
+ gfx::NativeView window = widget->GetNativeView();
+ if (chrome::GetHostDesktopTypeForNativeView(window) ==
+ chrome::HOST_DESKTOP_TYPE_ASH) {
+ gfx::Display display = gfx::Screen::GetScreenFor(window)->
+ GetDisplayMatching(*bounds);
+ bounds->AdjustToFit(display.work_area());
+ ash::wm::GetWindowState(window)->set_minimum_visibility(true);
+ }
+#endif
return true;
}
« no previous file with comments | « chrome/browser/ui/views/chrome_views_delegate.h ('k') | chrome/browser/ui/views/frame/browser_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698