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

Unified Diff: ui/app_list/views/app_list_view.cc

Issue 260663002: AppListController now responsible for ensuring app list stays centered. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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
« ash/wm/app_list_controller.cc ('K') | « ui/app_list/views/app_list_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_view.cc
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index 4924eb94504f515821c1d83c180ae4488c036d45..0233aaa9c3ee987ea52935f6048b8c73631b97e0 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -28,11 +28,9 @@
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_observer.h"
#include "ui/compositor/scoped_layer_animation_settings.h"
-#include "ui/gfx/display.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/path.h"
-#include "ui/gfx/screen.h"
#include "ui/gfx/skia_util.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/bubble/bubble_window_targeter.h"
@@ -131,8 +129,7 @@ AppListView::AppListView(AppListViewDelegate* delegate)
app_list_main_view_(NULL),
signin_view_(NULL),
speech_view_(NULL),
- animation_observer_(new HideViewAnimationObserver()),
- screen_to_keep_centered_on_(NULL) {
+ animation_observer_(new HideViewAnimationObserver()) {
CHECK(delegate);
delegate_->AddObserver(this);
@@ -157,7 +154,6 @@ void AppListView::InitAsBubbleAttachedToAnchor(
SetAnchorView(anchor);
InitAsBubbleInternal(
parent, pagination_model, arrow, border_accepts_events, anchor_offset);
- screen_to_keep_centered_on_ = NULL;
}
void AppListView::InitAsBubbleAtFixedLocation(
@@ -170,20 +166,6 @@ void AppListView::InitAsBubbleAtFixedLocation(
SetAnchorRect(gfx::Rect(anchor_point_in_screen, gfx::Size()));
InitAsBubbleInternal(
parent, pagination_model, arrow, border_accepts_events, gfx::Vector2d());
- screen_to_keep_centered_on_ = NULL;
-}
-
-void AppListView::InitAsBubbleCenteredOnPrimaryDisplay(
- gfx::NativeView parent,
- PaginationModel* pagination_model,
- gfx::Screen* screen_to_keep_centered_on,
- views::BubbleBorder::Arrow arrow,
- bool border_accepts_events) {
- screen_to_keep_centered_on_ = screen_to_keep_centered_on;
- SetAnchorView(NULL);
- SetAnchorRect(gfx::Rect(GetCenterPoint(), gfx::Size()));
- InitAsBubbleInternal(
- parent, pagination_model, arrow, border_accepts_events, gfx::Vector2d());
}
void AppListView::SetBubbleArrow(views::BubbleBorder::Arrow arrow) {
@@ -211,8 +193,6 @@ void AppListView::Close() {
}
void AppListView::UpdateBounds() {
- if (screen_to_keep_centered_on_)
- SetAnchorRect(gfx::Rect(GetCenterPoint(), gfx::Size()));
SizeToContents();
}
@@ -357,12 +337,6 @@ void AppListView::InitAsBubbleInternal(gfx::NativeView parent,
delegate_->ViewInitialized();
}
-gfx::Point AppListView::GetCenterPoint() {
- DCHECK(screen_to_keep_centered_on_);
- gfx::Rect bounds = screen_to_keep_centered_on_->GetPrimaryDisplay().bounds();
- return bounds.CenterPoint();
-}
-
void AppListView::OnBeforeBubbleWidgetInit(
views::Widget::InitParams* params,
views::Widget* widget) const {
« ash/wm/app_list_controller.cc ('K') | « ui/app_list/views/app_list_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698