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

Side by Side Diff: chrome/browser/ui/app_list/app_list_shower_views.cc

Issue 302803002: Refactor app list so AppsGridView owns the PaginationModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error (conflict). Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/app_list/app_list_shower_views.h ('k') | ui/app_list/views/app_list_demo.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/app_list/app_list_shower_views.h" 5 #include "chrome/browser/ui/app_list/app_list_shower_views.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/app_list/app_list_shower_delegate.h" 10 #include "chrome/browser/ui/app_list/app_list_shower_delegate.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 103
104 app_list::AppListView* AppListShower::MakeViewForCurrentProfile() { 104 app_list::AppListView* AppListShower::MakeViewForCurrentProfile() {
105 // The view delegate will be owned by the app list view. The app list view 105 // The view delegate will be owned by the app list view. The app list view
106 // manages its own lifetime. 106 // manages its own lifetime.
107 AppListViewDelegate* view_delegate = new AppListViewDelegate( 107 AppListViewDelegate* view_delegate = new AppListViewDelegate(
108 profile_, delegate_->GetControllerDelegateForCreate()); 108 profile_, delegate_->GetControllerDelegateForCreate());
109 app_list::AppListView* view = new app_list::AppListView(view_delegate); 109 app_list::AppListView* view = new app_list::AppListView(view_delegate);
110 gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint(); 110 gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint();
111 view->InitAsBubbleAtFixedLocation(NULL, 111 view->InitAsBubbleAtFixedLocation(NULL,
112 &pagination_model_, 112 0,
113 cursor, 113 cursor,
114 views::BubbleBorder::FLOAT, 114 views::BubbleBorder::FLOAT,
115 false /* border_accepts_events */); 115 false /* border_accepts_events */);
116 return view; 116 return view;
117 } 117 }
118 118
119 void AppListShower::UpdateViewForNewProfile() { 119 void AppListShower::UpdateViewForNewProfile() {
120 app_list_->SetProfileByPath(profile_->GetPath()); 120 app_list_->SetProfileByPath(profile_->GetPath());
121 } 121 }
122 122
123 void AppListShower::Show() { 123 void AppListShower::Show() {
124 app_list_->GetWidget()->Show(); 124 app_list_->GetWidget()->Show();
125 if (!window_icon_updated_) { 125 if (!window_icon_updated_) {
126 app_list_->GetWidget()->GetTopLevelWidget()->UpdateWindowIcon(); 126 app_list_->GetWidget()->GetTopLevelWidget()->UpdateWindowIcon();
127 window_icon_updated_ = true; 127 window_icon_updated_ = true;
128 } 128 }
129 app_list_->GetWidget()->Activate(); 129 app_list_->GetWidget()->Activate();
130 } 130 }
131 131
132 void AppListShower::Hide() { 132 void AppListShower::Hide() {
133 app_list_->GetWidget()->Hide(); 133 app_list_->GetWidget()->Hide();
134 } 134 }
135 135
136 void AppListShower::ResetKeepAlive() { 136 void AppListShower::ResetKeepAlive() {
137 keep_alive_.reset(); 137 keep_alive_.reset();
138 } 138 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_shower_views.h ('k') | ui/app_list/views/app_list_demo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698