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

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: . 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 d1e73a44ef18fa41dab21122f8e31ab7a3f1502d..d03af448bdaea6adc0bf4e3ec0930260e28d2656 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
@@ -55,7 +55,8 @@ DesktopRootWindowHostWin::DesktopRootWindowHostWin(
native_widget_delegate_(native_widget_delegate),
desktop_native_widget_aura_(desktop_native_widget_aura),
root_window_host_delegate_(NULL),
- content_window_(NULL) {
+ content_window_(NULL),
+ window_expansion_(0, 0, 0, 0) {
sky 2013/03/14 20:06:37 nit: this is the default.
scottmg 2013/03/14 22:51:53 Done.
}
DesktopRootWindowHostWin::~DesktopRootWindowHostWin() {
@@ -167,6 +168,10 @@ aura::RootWindow* DesktopRootWindowHostWin::Init(
return root_window_;
}
+void DesktopRootWindowHostWin::InitFocus(aura::Window* window) {
+ focus_client_->FocusWindow(window);
+}
+
void DesktopRootWindowHostWin::Close() {
message_handler_->Close();
}
@@ -379,7 +384,11 @@ gfx::Rect DesktopRootWindowHostWin::GetBounds() const {
}
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 +463,12 @@ void DesktopRootWindowHostWin::OnDeviceScaleFactorChanged(
void DesktopRootWindowHostWin::PrepareForShutdown() {
}
+void DesktopRootWindowHostWin::SetHostWindowExpansion(const gfx::Rect& extra) {
+ window_expansion_ = extra;
+ SetBounds(GetBounds());
+}
+
+
sky 2013/03/14 20:06:37 nit: remove one of these newlines.
scottmg 2013/03/14 22:51:53 Done.
////////////////////////////////////////////////////////////////////////////////
// DesktopRootWindowHostWin, HWNDMessageHandlerDelegate implementation:
@@ -652,10 +667,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