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

Unified Diff: ui/app_list/app_list_view.cc

Issue 10834140: aura: Fix launcher tooltips: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 5 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/app_list/app_list_view.cc
diff --git a/ui/app_list/app_list_view.cc b/ui/app_list/app_list_view.cc
index 4280f5dd6e9d808fc127a655c50ab68765ae5a3d..fbf836351e09ee88a722d1ed5d65ef612bf59b82 100644
--- a/ui/app_list/app_list_view.cc
+++ b/ui/app_list/app_list_view.cc
@@ -13,7 +13,6 @@
#include "ui/app_list/search_box_model.h"
#include "ui/app_list/search_box_view.h"
#include "ui/gfx/insets.h"
-#include "ui/gfx/screen.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/box_layout.h"
@@ -152,36 +151,15 @@ gfx::Rect AppListView::GetBubbleBounds() {
if (!bubble_border_)
return views::BubbleDelegateView::GetBubbleBounds();
- const gfx::Point old_offset = bubble_border_->offset();
const gfx::Rect anchor_rect = GetAnchorRect();
-
- bubble_border_->set_offset(gfx::Point());
gfx::Rect bubble_rect = GetBubbleFrameView()->GetUpdatedWindowBounds(
anchor_rect,
GetPreferredSize(),
false /* try_mirroring_arrow */);
- gfx::Rect monitor_rect = gfx::Screen::GetDisplayNearestPoint(
- anchor_rect.CenterPoint()).work_area();
- if (monitor_rect.IsEmpty() || monitor_rect.Contains(bubble_rect))
- return bubble_rect;
-
- gfx::Point offset;
-
- if (bubble_border_->ArrowAtTopOrBottom()) {
- if (bubble_rect.x() < monitor_rect.x())
- offset.set_x(monitor_rect.x() - bubble_rect.x());
- else if (bubble_rect.right() > monitor_rect.right())
- offset.set_x(monitor_rect.right() - bubble_rect.right());
- } else if (bubble_border_->ArrowOnLeftOrRight()) {
- if (bubble_rect.y() < monitor_rect.y())
- offset.set_y(monitor_rect.y() - bubble_rect.y());
- else if (bubble_rect.bottom() > monitor_rect.bottom())
- offset.set_y(monitor_rect.bottom() - bubble_rect.bottom());
- }
-
- bubble_rect.Offset(offset);
- bubble_border_->set_offset(offset);
+ const gfx::Point old_offset = bubble_border_->offset();
+ bubble_rect = bubble_border_->ComputeOffsetAndUpdateBubbleRect(bubble_rect,
+ anchor_rect);
// Repaints border if arrow offset is changed.
if (bubble_border_->offset() != old_offset)

Powered by Google App Engine
This is Rietveld 408576698