diff options
Diffstat (limited to 'ash')
-rw-r--r-- | ash/display/multi_display_manager.cc | 3 | ||||
-rw-r--r-- | ash/launcher/launcher_view_unittest.cc | 5 | ||||
-rw-r--r-- | ash/system/drive/tray_drive.cc | 12 | ||||
-rw-r--r-- | ash/wm/partial_screenshot_view.cc | 5 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_window_resizer.cc | 4 |
5 files changed, 13 insertions, 16 deletions
diff --git a/ash/display/multi_display_manager.cc b/ash/display/multi_display_manager.cc index d93321b..5911ae9 100644 --- a/ash/display/multi_display_manager.cc +++ b/ash/display/multi_display_manager.cc @@ -360,8 +360,7 @@ const gfx::Display& MultiDisplayManager::GetDisplayMatching( for (std::vector<gfx::Display>::const_iterator iter = displays_.begin(); iter != displays_.end(); ++iter) { const gfx::Display& display = *iter; - gfx::Rect intersect = display.bounds(); - intersect.Intersect(rect); + gfx::Rect intersect = gfx::IntersectRects(display.bounds(), rect); int area = intersect.width() * intersect.height(); if (area > max) { max = area; diff --git a/ash/launcher/launcher_view_unittest.cc b/ash/launcher/launcher_view_unittest.cc index 3e1e806..468e8f9 100644 --- a/ash/launcher/launcher_view_unittest.cc +++ b/ash/launcher/launcher_view_unittest.cc @@ -645,9 +645,8 @@ TEST_F(LauncherViewTest, ShouldHideTooltipTest) { gfx::Rect app_button_rect = GetButtonByID(app_button_id)->GetMirroredBounds(); gfx::Rect tab_button_rect = GetButtonByID(tab_button_id)->GetMirroredBounds(); ASSERT_FALSE(app_button_rect.Intersects(tab_button_rect)); - gfx::Rect union_rect = app_button_rect; - union_rect.Union(tab_button_rect); - EXPECT_FALSE(launcher_view_->ShouldHideTooltip(union_rect.CenterPoint())); + EXPECT_FALSE(launcher_view_->ShouldHideTooltip( + gfx::UnionRects(app_button_rect, tab_button_rect).CenterPoint())); // The tooltip should hide if it's outside of all buttons. gfx::Rect all_area; diff --git a/ash/system/drive/tray_drive.cc b/ash/system/drive/tray_drive.cc index 489427e..d829dac 100644 --- a/ash/system/drive/tray_drive.cc +++ b/ash/system/drive/tray_drive.cc @@ -220,8 +220,8 @@ class DriveDetailedView : public TrayDetailsView, kBottomPadding - status_img_->GetPreferredSize().height())/2), status_img_->GetPreferredSize()); - bounds_status.Intersect(child_area); - status_img_->SetBoundsRect(bounds_status); + status_img_->SetBoundsRect( + gfx::IntersectRects(bounds_status, child_area)); pos_x += status_img_->bounds().width() + kHorizontalPadding; gfx::Rect bounds_label(pos_x, @@ -231,8 +231,8 @@ class DriveDetailedView : public TrayDetailsView, status_img_->GetPreferredSize().width() - cancel_button_->GetPreferredSize().width(), label_container_->GetPreferredSize().height()); - bounds_label.Intersect(child_area); - label_container_->SetBoundsRect(bounds_label); + label_container_->SetBoundsRect( + gfx::IntersectRects(bounds_label, child_area)); pos_x += label_container_->bounds().width() + kHorizontalPadding; gfx::Rect bounds_button( @@ -241,8 +241,8 @@ class DriveDetailedView : public TrayDetailsView, kBottomPadding - cancel_button_->GetPreferredSize().height())/2), cancel_button_->GetPreferredSize()); - bounds_button.Intersect(child_area); - cancel_button_->SetBoundsRect(bounds_button); + cancel_button_->SetBoundsRect( + gfx::IntersectRects(bounds_button, child_area)); } // views::ButtonListener overrides. diff --git a/ash/wm/partial_screenshot_view.cc b/ash/wm/partial_screenshot_view.cc index dd0bd1da..a02ca7e 100644 --- a/ash/wm/partial_screenshot_view.cc +++ b/ash/wm/partial_screenshot_view.cc @@ -121,10 +121,9 @@ void PartialScreenshotView::OnMouseReleased(const ui::MouseEvent& event) { is_dragging_ = false; if (screenshot_delegate_) { aura::RootWindow *root_window = Shell::GetPrimaryRootWindow(); - gfx::Rect root_window_screenshot_rect = root_window->bounds(); - root_window_screenshot_rect.Intersect(GetScreenshotRect()); screenshot_delegate_->HandleTakePartialScreenshot( - root_window, root_window_screenshot_rect); + root_window, + gfx::IntersectRects(root_window->bounds(), GetScreenshotRect())); } } diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc index 4a7e9cc..67145f5 100644 --- a/ash/wm/workspace/workspace_window_resizer.cc +++ b/ash/wm/workspace/workspace_window_resizer.cc @@ -707,8 +707,8 @@ void WorkspaceWindowResizer::UpdateDragPhantomWindow(const gfx::Rect& bounds, const gfx::Rect root_bounds_in_screen(another_root->GetBoundsInScreen()); const gfx::Rect bounds_in_screen = ScreenAsh::ConvertRectToScreen(window()->parent(), bounds); - gfx::Rect bounds_in_another_root = root_bounds_in_screen; - bounds_in_another_root.Intersect(bounds_in_screen); + gfx::Rect bounds_in_another_root = + gfx::IntersectRects(root_bounds_in_screen, bounds_in_screen); const float fraction_in_another_window = (bounds_in_another_root.width() * bounds_in_another_root.height()) / |