| 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() {
|
|
|