OLD | NEW |
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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
15 #include "chrome/browser/feedback/feedback_util.h" | 15 #include "chrome/browser/feedback/feedback_util.h" |
16 #include "chrome/browser/profiles/profile_info_cache.h" | 16 #include "chrome/browser/profiles/profile_info_cache.h" |
17 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
18 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 18 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
19 #include "chrome/browser/ui/app_list/apps_model_builder.h" | 19 #include "chrome/browser/ui/app_list/apps_model_builder.h" |
20 #include "chrome/browser/ui/app_list/chrome_app_list_item.h" | |
21 #include "chrome/browser/ui/app_list/search/search_controller.h" | 20 #include "chrome/browser/ui/app_list/search/search_controller.h" |
22 #include "chrome/browser/ui/app_list/start_page_service.h" | 21 #include "chrome/browser/ui/app_list/start_page_service.h" |
23 #include "chrome/browser/ui/browser_finder.h" | 22 #include "chrome/browser/ui/browser_finder.h" |
24 #include "chrome/browser/ui/chrome_pages.h" | 23 #include "chrome/browser/ui/chrome_pages.h" |
25 #include "chrome/browser/ui/host_desktop.h" | 24 #include "chrome/browser/ui/host_desktop.h" |
26 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 25 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
27 #include "chrome/browser/web_applications/web_app.h" | 26 #include "chrome/browser/web_applications/web_app.h" |
28 #include "chrome/common/extensions/extension_constants.h" | 27 #include "chrome/common/extensions/extension_constants.h" |
29 #include "chrome/common/url_constants.h" | 28 #include "chrome/common/url_constants.h" |
30 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 controller_.get())); | 156 controller_.get())); |
158 | 157 |
159 // Initialize the profile information in the app list menu. | 158 // Initialize the profile information in the app list menu. |
160 OnProfileChanged(); | 159 OnProfileChanged(); |
161 } | 160 } |
162 | 161 |
163 app_list::SigninDelegate* AppListViewDelegate::GetSigninDelegate() { | 162 app_list::SigninDelegate* AppListViewDelegate::GetSigninDelegate() { |
164 return &signin_delegate_; | 163 return &signin_delegate_; |
165 } | 164 } |
166 | 165 |
167 void AppListViewDelegate::ActivateAppListItem( | |
168 app_list::AppListItemModel* item, | |
169 int event_flags) { | |
170 content::RecordAction(content::UserMetricsAction("AppList_ClickOnApp")); | |
171 static_cast<ChromeAppListItem*>(item)->Activate(event_flags); | |
172 } | |
173 | |
174 void AppListViewDelegate::GetShortcutPathForApp( | 166 void AppListViewDelegate::GetShortcutPathForApp( |
175 const std::string& app_id, | 167 const std::string& app_id, |
176 const base::Callback<void(const base::FilePath&)>& callback) { | 168 const base::Callback<void(const base::FilePath&)>& callback) { |
177 #if defined(OS_WIN) | 169 #if defined(OS_WIN) |
178 ExtensionService* service = profile_->GetExtensionService(); | 170 ExtensionService* service = profile_->GetExtensionService(); |
179 DCHECK(service); | 171 DCHECK(service); |
180 const extensions::Extension* extension = | 172 const extensions::Extension* extension = |
181 service->GetInstalledExtension(app_id); | 173 service->GetInstalledExtension(app_id); |
182 if (!extension) { | 174 if (!extension) { |
183 callback.Run(base::FilePath()); | 175 callback.Run(base::FilePath()); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 } | 286 } |
295 | 287 |
296 content::WebContents* AppListViewDelegate::GetStartPageContents() { | 288 content::WebContents* AppListViewDelegate::GetStartPageContents() { |
297 app_list::StartPageService* service = | 289 app_list::StartPageService* service = |
298 app_list::StartPageService::Get(profile_); | 290 app_list::StartPageService::Get(profile_); |
299 if (!service) | 291 if (!service) |
300 return NULL; | 292 return NULL; |
301 | 293 |
302 return service->contents(); | 294 return service->contents(); |
303 } | 295 } |
OLD | NEW |