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

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

Issue 20656002: Add profile selector menu to app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_view_delegate.h" 5 #include "chrome/browser/ui/app_list/app_list_view_delegate.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 base::Bind(web_app::CreateShortcutInWebAppDir, app_data_dir, info), 47 base::Bind(web_app::CreateShortcutInWebAppDir, app_data_dir, info),
48 callback); 48 callback);
49 } 49 }
50 #endif 50 #endif
51 51
52 } // namespace 52 } // namespace
53 53
54 AppListViewDelegate::AppListViewDelegate(AppListControllerDelegate* controller, 54 AppListViewDelegate::AppListViewDelegate(AppListControllerDelegate* controller,
55 Profile* profile) 55 Profile* profile)
56 : controller_(controller), 56 : controller_(controller),
57 profile_(profile) {} 57 profile_(profile),
58 avatar_menu_model_(
koz (OOO until 15th September) 2013/07/26 06:30:18 Better to pass this in.
calamity 2013/07/26 09:13:29 Done.
59 &g_browser_process->profile_manager()->GetProfileInfoCache(),
60 NULL,
61 NULL) {}
58 62
59 AppListViewDelegate::~AppListViewDelegate() {} 63 AppListViewDelegate::~AppListViewDelegate() {}
60 64
61 void AppListViewDelegate::SetModel(app_list::AppListModel* model) { 65 void AppListViewDelegate::SetModel(app_list::AppListModel* model) {
62 if (model) { 66 if (model) {
63 apps_builder_.reset(new AppsModelBuilder(profile_, 67 apps_builder_.reset(new AppsModelBuilder(profile_,
64 model->apps(), 68 model->apps(),
65 controller_.get())); 69 controller_.get()));
66 apps_builder_->Build(); 70 apps_builder_->Build();
67 71
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 } 206 }
203 207
204 void AppListViewDelegate::OpenFeedback() { 208 void AppListViewDelegate::OpenFeedback() {
205 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( 209 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow(
206 controller_->GetAppListWindow()); 210 controller_->GetAppListWindow());
207 Browser* browser = chrome::FindOrCreateTabbedBrowser( 211 Browser* browser = chrome::FindOrCreateTabbedBrowser(
208 profile_, desktop); 212 profile_, desktop);
209 chrome::ShowFeedbackPage(browser, std::string(), 213 chrome::ShowFeedbackPage(browser, std::string(),
210 chrome::kAppLauncherCategoryTag); 214 chrome::kAppLauncherCategoryTag);
211 } 215 }
216
217 std::vector<AvatarMenuItemModel> AppListViewDelegate::GetAvatarMenuItems() {
218 std::vector<AvatarMenuItemModel> items;
219 for (size_t i = 0; i < avatar_menu_model_.GetNumberOfItems(); ++i) {
220 items.push_back(avatar_menu_model_.GetItemAt(i));
221 }
222 return items;
223 }
224
225 void AppListViewDelegate::ShowForProfileAtIndex(size_t index) {
226 controller_->ShowForProfileAtIndex(index);
227 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698