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

Issue 133003002: Revert 244005 "Remove SetHostSize/Bounds from RootWindow in favo..." (Closed)

Created:
6 years, 11 months ago by Noam Samuel
Modified:
6 years, 11 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Revert 244005 "Remove SetHostSize/Bounds from RootWindow in favo..." > Remove SetHostSize/Bounds from RootWindow in favor of just calling SetBounds() on host() > > R=sky@chromium.org > http://crbug.com/308846 > > Review URL: https://codereview.chromium.org/128753002 TBR=ben@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=244033

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+50 lines, -23 lines) Patch
M trunk/src/ash/display/display_controller.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M trunk/src/ash/display/mirror_window_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M trunk/src/ash/display/virtual_keyboard_window_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M trunk/src/ash/wm/screen_dimmer_unittest.cc View 1 chunk +3 lines, -3 lines 0 comments Download
M trunk/src/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc View 1 chunk +1 line, -1 line 0 comments Download
M trunk/src/content/shell/browser/shell_aura.cc View 1 chunk +1 line, -1 line 0 comments Download
M trunk/src/content/shell/browser/shell_views.cc View 1 chunk +2 lines, -1 line 0 comments Download
M trunk/src/ui/aura/root_window.h View 1 chunk +6 lines, -0 lines 0 comments Download
M trunk/src/ui/aura/root_window.cc View 2 chunks +27 lines, -8 lines 0 comments Download
M trunk/src/ui/aura/test/aura_test_helper.cc View 1 chunk +1 line, -1 line 0 comments Download
M trunk/src/ui/views/corewm/capture_controller_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M trunk/src/ui/views/widget/desktop_aura/desktop_screen_position_client.cc View 1 chunk +1 line, -1 line 0 comments Download
M trunk/src/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc View 1 chunk +1 line, -1 line 0 comments Download
M trunk/src/ui/views/widget/native_widget_aura_unittest.cc View 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Noam Samuel
6 years, 11 months ago (2014-01-10 01:07:16 UTC) #1
Noam Samuel
Committed patchset #1 manually as r244033.
6 years, 11 months ago (2014-01-10 01:08:53 UTC) #2
Ben Goodger (Google)
Hi - what went wrong? -Ben On Thu, Jan 9, 2014 at 5:07 PM, <noamsml@chromium.org> ...
6 years, 11 months ago (2014-01-10 16:33:59 UTC) #3
Noam Samuel (WRONG ACCOUNT)
6 years, 11 months ago (2014-01-10 17:26:54 UTC) #4
Oh, sorry for not communicating this better. This revert was intended to
fix
http://build.chromium.org/p/chromium.linux/builders/Linux%20Aura%20Tests/buil...,
and it seemed to do it successfully:
http://build.chromium.org/p/chromium.linux/builders/Linux%20Aura%20Tests/buil...


On Fri, Jan 10, 2014 at 8:33 AM, Ben Goodger (Google) <ben@chromium.org>wrote:

> Hi - what went wrong?
>
> -Ben
>
> On Thu, Jan 9, 2014 at 5:07 PM, <noamsml@chromium.org> wrote:
>
>> Reviewers: Ben Goodger (Google),
>>
>> Description:
>> Revert 244005 "Remove SetHostSize/Bounds from RootWindow in favo..."
>>
>>  Remove SetHostSize/Bounds from RootWindow in favor of just calling
>>> SetBounds()
>>>
>> on host()
>>
>>  R=sky@chromium.org
>>> http://crbug.com/308846
>>>
>>
>>  Review URL: https://codereview.chromium.org/128753002
>>>
>>
>> TBR=ben@chromium.org
>>
>> Please review this at https://codereview.chromium.org/133003002/
>>
>> SVN Base: svn://svn.chromium.org/chrome/
>>
>> Affected files (+50, -23 lines):
>>   M     trunk/src/ash/display/display_controller.cc
>>   M     trunk/src/ash/display/mirror_window_controller.cc
>>   M     trunk/src/ash/display/virtual_keyboard_window_controller.cc
>>   M     trunk/src/ash/wm/screen_dimmer_unittest.cc
>>   M     trunk/src/content/browser/web_contents/touch_editable_impl_
>> aura_browsertest.cc
>>   M     trunk/src/content/shell/browser/shell_aura.cc
>>   M     trunk/src/content/shell/browser/shell_views.cc
>>   M     trunk/src/ui/aura/root_window.h
>>   M     trunk/src/ui/aura/root_window.cc
>>   M     trunk/src/ui/aura/test/aura_test_helper.cc
>>   M     trunk/src/ui/views/corewm/capture_controller_unittest.cc
>>   M     trunk/src/ui/views/widget/desktop_aura/desktop_screen_
>> position_client.cc
>>   M     trunk/src/ui/views/widget/desktop_aura/x11_desktop_
>> window_move_client.cc
>>   M     trunk/src/ui/views/widget/native_widget_aura_unittest.cc
>>
>>
>> Index: trunk/src/ash/display/display_controller.cc
>> ===================================================================
>> --- trunk/src/ash/display/display_controller.cc (revision 244032)
>> +++ trunk/src/ash/display/display_controller.cc (working copy)
>> @@ -616,7 +616,7 @@
>>    DCHECK(!display_info.bounds_in_native().IsEmpty());
>>    aura::WindowEventDispatcher* dispatcher =
>>        root_windows_[display.id()]->GetDispatcher();
>> -  dispatcher->host()->SetBounds(display_info.bounds_in_native());
>> +  dispatcher->SetHostBounds(display_info.bounds_in_native());
>>    SetDisplayPropertiesOnHostWindow(dispatcher, display);
>>  }
>>
>> @@ -632,7 +632,7 @@
>>          GetDisplayManager()->GetDisplayInfo(display.id());
>>      aura::WindowEventDispatcher* dispatcher =
>>          root_windows_[display.id()]->GetDispatcher();
>> -    dispatcher->host()->SetBounds(display_info.bounds_in_native());
>> +    dispatcher->SetHostBounds(display_info.bounds_in_native());
>>      SetDisplayPropertiesOnHostWindow(dispatcher, display);
>>    } else {
>>      if (primary_display_id == gfx::Display::kInvalidDisplayID)
>> Index: trunk/src/ash/display/mirror_window_controller.cc
>> ===================================================================
>> --- trunk/src/ash/display/mirror_window_controller.cc   (revision 244032)
>> +++ trunk/src/ash/display/mirror_window_controller.cc   (working copy)
>> @@ -204,7 +204,7 @@
>>    } else {
>>      GetRootWindowSettings(root_window_->window())->display_id =
>>          display_info.id();
>> -    root_window_->host()->SetBounds(display_info.bounds_in_native());
>> +    root_window_->SetHostBounds(display_info.bounds_in_native());
>>    }
>>
>>    DisplayManager* display_manager = Shell::GetInstance()->display_
>> manager();
>> Index: trunk/src/ash/display/virtual_keyboard_window_controller.cc
>> ===================================================================
>> --- trunk/src/ash/display/virtual_keyboard_window_controller.cc
>> (revision 244032)
>> +++ trunk/src/ash/display/virtual_keyboard_window_controller.cc (working
>> copy)
>> @@ -68,7 +68,7 @@
>>      aura::RootWindow* root_window = root_window_controller_->
>> dispatcher();
>>      GetRootWindowSettings(root_window->window())->display_id =
>>          display_info.id();
>> -    root_window->host()->SetBounds(display_info.bounds_in_native());
>> +    root_window->SetHostBounds(display_info.bounds_in_native());
>>    }
>>  }
>>
>> Index: trunk/src/ash/wm/screen_dimmer_unittest.cc
>> ===================================================================
>> --- trunk/src/ash/wm/screen_dimmer_unittest.cc  (revision 244032)
>> +++ trunk/src/ash/wm/screen_dimmer_unittest.cc  (working copy)
>> @@ -70,9 +70,9 @@
>>
>>    // When we resize the root window, the dimming layer should be resized
>> to
>>    // match.
>> -  gfx::Rect kNewBounds(400, 300);
>> -  Shell::GetPrimaryRootWindow()->GetDispatcher()->host()->
>> SetBounds(kNewBounds);
>> -  EXPECT_EQ(kNewBounds.ToString(), dimming_layer->bounds().ToString());
>> +  gfx::Size kNewSize(400, 300);
>> +  Shell::GetPrimaryRootWindow()->GetDispatcher()->SetHostSize(kNewSize);
>> +  EXPECT_EQ(kNewSize.ToString(), dimming_layer->bounds().size()
>> .ToString());
>>  }
>>
>>  }  // namespace test
>> Index: trunk/src/content/browser/web_contents/touch_editable_impl_
>> aura_browsertest.cc
>> ===================================================================
>> ---
trunk/src/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc
>>      (revision 244032)
>> +++
trunk/src/content/browser/web_contents/touch_editable_impl_aura_browsertest.cc
>>      (working copy)
>> @@ -137,7 +137,7 @@
>>      NavigateToURL(shell(), test_url);
>>      aura::Window* content =
>>          shell()->web_contents()->GetView()->GetContentNativeView();
>> -    content->GetDispatcher()->host()->SetBounds(gfx::Rect(800, 600));
>> +    content->GetDispatcher()->SetHostSize(gfx::Size(800, 600));
>>    }
>>
>>    void TestTouchSelectionOriginatingFromWebpage() {
>> Index: trunk/src/content/shell/browser/shell_aura.cc
>> ===================================================================
>> --- trunk/src/content/shell/browser/shell_aura.cc       (revision 244032)
>> +++ trunk/src/content/shell/browser/shell_aura.cc       (working copy)
>> @@ -147,7 +147,7 @@
>>  }
>>
>>  void ShellAuraPlatformData::ResizeWindow(int width, int height) {
>> -  root_window_->host()->SetBounds(gfx::Rect(width, height));
>> +  root_window_->SetHostSize(gfx::Size(width, height));
>>  }
>>
>>  // static
>> Index: trunk/src/content/shell/browser/shell_views.cc
>> ===================================================================
>> --- trunk/src/content/shell/browser/shell_views.cc      (revision 244032)
>> +++ trunk/src/content/shell/browser/shell_views.cc      (working copy)
>> @@ -101,7 +101,8 @@
>>      // Resizing a widget on chromeos doesn't automatically resize the
>> root, need
>>      // to explicitly do that.
>>  #if defined(OS_CHROMEOS)
>> -    GetWidget()->GetNativeWindow()->GetDispatcher()->host()->
>> SetBounds(bounds);
>> +    GetWidget()->GetNativeWindow()->GetDispatcher()->SetHostSize(
>> +        bounds.size());
>>  #endif
>>    }
>>
>> Index: trunk/src/ui/aura/root_window.cc
>> ===================================================================
>> --- trunk/src/ui/aura/root_window.cc    (revision 244032)
>> +++ trunk/src/ui/aura/root_window.cc    (working copy)
>> @@ -194,6 +194,33 @@
>>    return this;
>>  }
>>
>> +void RootWindow::SetHostSize(const gfx::Size& size_in_pixel) {
>> +  DispatchDetails details = DispatchHeldEvents();
>> +  if (details.dispatcher_destroyed)
>> +    return;
>> +  gfx::Rect bounds = host_->GetBounds();
>> +  bounds.set_size(size_in_pixel);
>> +  host_->SetBounds(bounds);
>> +
>> +  // Requery the location to constrain it within the new root window
>> size.
>> +  gfx::Point point;
>> +  if (host_->QueryMouseLocation(&point)) {
>> +    SetLastMouseLocation(window(),
>> +                         ui::ConvertPointToDIP(window()->layer(),
>> point));
>> +  }
>> +
>> +  synthesize_mouse_move_ = false;
>> +}
>> +
>> +void RootWindow::SetHostBounds(const gfx::Rect& bounds_in_pixel) {
>> +  DCHECK(!bounds_in_pixel.IsEmpty());
>> +  DispatchDetails details = DispatchHeldEvents();
>> +  if (details.dispatcher_destroyed)
>> +    return;
>> +  host_->SetBounds(bounds_in_pixel);
>> +  synthesize_mouse_move_ = false;
>> +}
>> +
>>  void RootWindow::SetCursor(gfx::NativeCursor cursor) {
>>    last_cursor_ = cursor;
>>    // A lot of code seems to depend on NULL cursors actually showing an
>> arrow,
>> @@ -713,14 +740,6 @@
>>      return;
>>    FOR_EACH_OBSERVER(RootWindowObserver, observers_,
>>                      OnWindowTreeHostResized(this));
>> -
>> -  // Constrain the mouse position within the new root Window size.
>> -  gfx::Point point;
>> -  if (host_->QueryMouseLocation(&point)) {
>> -    SetLastMouseLocation(window(),
>> -                         ui::ConvertPointToDIP(window()->layer(),
>> point));
>> -  }
>> -  synthesize_mouse_move_ = false;
>>  }
>>
>>  RootWindow* RootWindow::AsRootWindow() {
>> Index: trunk/src/ui/aura/root_window.h
>> ===================================================================
>> --- trunk/src/ui/aura/root_window.h     (revision 244032)
>> +++ trunk/src/ui/aura/root_window.h     (working copy)
>> @@ -103,6 +103,12 @@
>>
>>    WindowTreeHostDelegate* AsWindowTreeHostDelegate();
>>
>> +  // Gets/sets the size of the host window.
>> +  void SetHostSize(const gfx::Size& size_in_pixel);
>> +
>> +  // Sets the bounds of the host window.
>> +  void SetHostBounds(const gfx::Rect& size_in_pizel);
>> +
>>    // Sets the currently-displayed cursor. If the cursor was previously
>> hidden
>>    // via ShowCursor(false), it will remain hidden until ShowCursor(true)
>> is
>>    // called, at which point the cursor that was last set via SetCursor()
>> will be
>> Index: trunk/src/ui/aura/test/aura_test_helper.cc
>> ===================================================================
>> --- trunk/src/ui/aura/test/aura_test_helper.cc  (revision 244032)
>> +++ trunk/src/ui/aura/test/aura_test_helper.cc  (working copy)
>> @@ -93,7 +93,7 @@
>>
>>    root_window()->Show();
>>    // Ensure width != height so tests won't confuse them.
>> -  dispatcher()->host()->SetBounds(gfx::Rect(800, 600));
>> +  dispatcher()->SetHostSize(gfx::Size(800, 600));
>>  }
>>
>>  void AuraTestHelper::TearDown() {
>> Index: trunk/src/ui/views/corewm/capture_controller_unittest.cc
>> ===================================================================
>> --- trunk/src/ui/views/corewm/capture_controller_unittest.cc
>>  (revision 244032)
>> +++ trunk/src/ui/views/corewm/capture_controller_unittest.cc    (working
>> copy)
>> @@ -38,7 +38,7 @@
>>          aura::RootWindow::CreateParams(gfx::Rect(0, 0, 800, 600))));
>>      second_root_->Init();
>>      second_root_->window()->Show();
>> -    second_root_->host()->SetBounds(gfx::Rect(800, 600));
>> +    second_root_->SetHostSize(gfx::Size(800, 600));
>>      second_capture_controller_.reset(
>>          new corewm::ScopedCaptureClient(second_root_->window()));
>>
>> Index: trunk/src/ui/views/widget/desktop_aura/desktop_screen_
>> position_client.cc
>> ===================================================================
>> --- trunk/src/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
>>    (revision 244032)
>> +++ trunk/src/ui/views/widget/desktop_aura/desktop_screen_position_client.cc
>>    (working copy)
>> @@ -89,7 +89,7 @@
>>    DesktopNativeWidgetAura* desktop_native_widget =
>>        DesktopNativeWidgetAura::ForWindow(window);
>>    if (desktop_native_widget) {
>> -    root->GetDispatcher()->host()->SetBounds(bounds);
>> +    root->GetDispatcher()->SetHostBounds(bounds);
>>      // Setting bounds of root resizes |window|.
>>    } else {
>>      window->SetBounds(bounds);
>> Index: trunk/src/ui/views/widget/desktop_aura/x11_desktop_
>> window_move_client.cc
>> ===================================================================
>> --- trunk/src/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc
>>    (revision 244032)
>> +++ trunk/src/ui/views/widget/desktop_aura/x11_desktop_window_move_client.cc
>>    (working copy)
>> @@ -93,7 +93,7 @@
>>  // DesktopWindowTreeHostLinux, private:
>>
>>  void X11DesktopWindowMoveClient::SetHostBounds(const gfx::Rect& rect) {
>> -  root_window_->host()->SetBounds(rect);
>> +  root_window_->SetHostBounds(rect);
>>  }
>>
>>  }  // namespace views
>> Index: trunk/src/ui/views/widget/native_widget_aura_unittest.cc
>> ===================================================================
>> --- trunk/src/ui/views/widget/native_widget_aura_unittest.cc
>>  (revision 244032)
>> +++ trunk/src/ui/views/widget/native_widget_aura_unittest.cc    (working
>> copy)
>> @@ -40,7 +40,8 @@
>>    // testing::Test overrides:
>>    virtual void SetUp() OVERRIDE {
>>      ViewsTestBase::SetUp();
>> -    dispatcher()->host()->SetBounds(gfx::Rect(640, 480));
>> +    root_window()->SetBounds(gfx::Rect(0, 0, 640, 480));
>> +    dispatcher()->SetHostSize(gfx::Size(640, 480));
>>    }
>>
>>   protected:
>>
>>
>>
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698