| Index: ui/app_list/views/app_list_view.cc
|
| ===================================================================
|
| --- ui/app_list/views/app_list_view.cc (revision 179305)
|
| +++ ui/app_list/views/app_list_view.cc (working copy)
|
| @@ -9,11 +9,9 @@
|
| #include "ui/app_list/app_list_model.h"
|
| #include "ui/app_list/app_list_view_delegate.h"
|
| #include "ui/app_list/pagination_model.h"
|
| -#include "ui/app_list/signin_delegate.h"
|
| #include "ui/app_list/views/app_list_background.h"
|
| #include "ui/app_list/views/app_list_main_view.h"
|
| #include "ui/app_list/views/search_box_view.h"
|
| -#include "ui/app_list/views/signin_view.h"
|
| #include "ui/gfx/insets.h"
|
| #include "ui/gfx/path.h"
|
| #include "ui/gfx/skia_util.h"
|
| @@ -37,18 +35,12 @@
|
| AppListView::AppListView(AppListViewDelegate* delegate)
|
| : model_(new AppListModel),
|
| delegate_(delegate),
|
| - app_list_main_view_(NULL),
|
| - signin_view_(NULL) {
|
| + app_list_main_view_(NULL) {
|
| if (delegate_)
|
| delegate_->SetModel(model_.get());
|
| - if (GetSigninDelegate())
|
| - GetSigninDelegate()->AddObserver(this);
|
| }
|
|
|
| AppListView::~AppListView() {
|
| - if (GetSigninDelegate())
|
| - GetSigninDelegate()->RemoveObserver(this);
|
| -
|
| // Models are going away, ensure their references are cleared.
|
| RemoveAllChildViews(true);
|
| }
|
| @@ -59,20 +51,19 @@
|
| views::View* anchor,
|
| const gfx::Point& anchor_point,
|
| views::BubbleBorder::ArrowLocation arrow_location) {
|
| -
|
| app_list_main_view_ = new AppListMainView(delegate_.get(),
|
| model_.get(),
|
| pagination_model,
|
| anchor);
|
| - AddChildView(app_list_main_view_);
|
| + SetLayoutManager(new views::FillLayout());
|
| +
|
| #if defined(USE_AURA)
|
| app_list_main_view_->SetPaintToLayer(true);
|
| app_list_main_view_->SetFillsBoundsOpaquely(false);
|
| app_list_main_view_->layer()->SetMasksToBounds(true);
|
| #endif
|
|
|
| - signin_view_ = new SigninView(GetSigninDelegate());
|
| - AddChildView(signin_view_);
|
| + AddChildView(app_list_main_view_);
|
|
|
| set_anchor_view(anchor);
|
| set_anchor_point(anchor_point);
|
| @@ -130,10 +121,6 @@
|
| SizeToContents();
|
| }
|
|
|
| -gfx::Size AppListView::GetPreferredSize() {
|
| - return app_list_main_view_->GetPreferredSize();
|
| -}
|
| -
|
| views::View* AppListView::GetInitiallyFocusedView() {
|
| return app_list_main_view_->search_box_view()->search_box();
|
| }
|
| @@ -158,22 +145,6 @@
|
| return false;
|
| }
|
|
|
| -void AppListView::Layout() {
|
| - if (!signin_view_) {
|
| - app_list_main_view_->SetBounds(0, 0, width(), height());
|
| - return;
|
| - }
|
| -
|
| - if (GetSigninDelegate() && GetSigninDelegate()->NeedSignin()) {
|
| - signin_view_->SetBounds(0, 0, width(), height());
|
| - app_list_main_view_->SetBounds(width(), 0, width(), height());
|
| - return;
|
| - }
|
| -
|
| - signin_view_->SetBounds(-width(), 0, width(), height());
|
| - app_list_main_view_->SetBounds(0, 0, width(), height());
|
| -}
|
| -
|
| void AppListView::OnWidgetClosing(views::Widget* widget) {
|
| BubbleDelegateView::OnWidgetClosing(widget);
|
| if (delegate_.get() && widget == GetWidget())
|
| @@ -188,24 +159,4 @@
|
| delegate_->ViewActivationChanged(active);
|
| }
|
|
|
| -void AppListView::OnWidgetVisibilityChanged(views::Widget* widget,
|
| - bool visible) {
|
| - BubbleDelegateView::OnWidgetVisibilityChanged(widget, visible);
|
| -
|
| - if (widget != GetWidget())
|
| - return;
|
| -
|
| - Layout();
|
| - if (visible && GetSigninDelegate() && GetSigninDelegate()->NeedSignin())
|
| - signin_view_->BeginSignin();
|
| -}
|
| -
|
| -void AppListView::OnSigninSuccess() {
|
| - Layout();
|
| -}
|
| -
|
| -SigninDelegate* AppListView::GetSigninDelegate() {
|
| - return delegate_ ? delegate_->GetSigninDelegate() : NULL;
|
| -}
|
| -
|
| } // namespace app_list
|
|
|