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

Unified Diff: ui/views/widget/desktop_aura/desktop_root_window_host_win.cc

Issue 12342028: make menus, bubbles, etc. top level windows on aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes Created 7 years, 9 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
Index: ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
diff --git a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
index 5997cf1a75b76aedaeabb22b99ac3d5d2dc04399..1099c63fe9a227533482dab6ae2a240ca863e849 100644
--- a/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
+++ b/ui/views/widget/desktop_aura/desktop_root_window_host_win.cc
@@ -167,6 +167,10 @@ aura::RootWindow* DesktopRootWindowHostWin::Init(
return root_window_;
}
+void DesktopRootWindowHostWin::InitFocus(aura::Window* window) {
+ focus_client_->FocusWindow(window);
+}
+
void DesktopRootWindowHostWin::Close() {
message_handler_->Close();
}
@@ -374,12 +378,21 @@ void DesktopRootWindowHostWin::ToggleFullScreen() {
gfx::Rect DesktopRootWindowHostWin::GetBounds() const {
// Match the logic in HWNDMessageHandler::ClientAreaSizeChanged().
- return WidgetSizeIsClientSize() ?
- GetClientAreaBoundsInScreen() : GetWindowBoundsInScreen();
+ gfx::Rect bounds(WidgetSizeIsClientSize() ? GetClientAreaBoundsInScreen()
+ : GetWindowBoundsInScreen());
+ gfx::Rect without_expansion(bounds.x() - window_expansion_.x(),
+ bounds.y() - window_expansion_.y(),
+ bounds.width() - window_expansion_.width(),
+ bounds.height() - window_expansion_.height());
+ return without_expansion;
}
void DesktopRootWindowHostWin::SetBounds(const gfx::Rect& bounds) {
- message_handler_->SetBounds(bounds);
+ gfx::Rect expanded(bounds.x() + window_expansion_.x(),
+ bounds.y() + window_expansion_.y(),
+ bounds.width() + window_expansion_.width(),
+ bounds.height() + window_expansion_.height());
+ message_handler_->SetBounds(expanded);
}
gfx::Insets DesktopRootWindowHostWin::GetInsets() const {
@@ -454,6 +467,12 @@ void DesktopRootWindowHostWin::OnDeviceScaleFactorChanged(
void DesktopRootWindowHostWin::PrepareForShutdown() {
}
+void DesktopRootWindowHostWin::SetHostWindowExpansion(const gfx::Rect& extra) {
+ gfx::Rect bounds_without_expansion = GetBounds();
+ window_expansion_ = extra;
+ SetBounds(bounds_without_expansion);
+}
+
////////////////////////////////////////////////////////////////////////////////
// DesktopRootWindowHostWin, HWNDMessageHandlerDelegate implementation:
@@ -656,10 +675,12 @@ void DesktopRootWindowHostWin::HandleVisibilityChanged(bool visible) {
void DesktopRootWindowHostWin::HandleClientSizeChanged(
const gfx::Size& new_size) {
+ gfx::Size without_expansion(new_size.width() - window_expansion_.width(),
+ new_size.height() - window_expansion_.height());
if (root_window_host_delegate_)
root_window_host_delegate_->OnHostResized(new_size);
// TODO(beng): replace with a layout manager??
- content_window_->SetBounds(gfx::Rect(new_size));
+ content_window_->SetBounds(gfx::Rect(without_expansion));
}
void DesktopRootWindowHostWin::HandleFrameChanged() {

Powered by Google App Engine
This is Rietveld 408576698