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/metrics/user_metrics.h" |
11 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chrome_notification_types.h" | 14 #include "chrome/browser/chrome_notification_types.h" |
14 #include "chrome/browser/extensions/extension_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
15 #include "chrome/browser/feedback/feedback_util.h" | 16 #include "chrome/browser/feedback/feedback_util.h" |
16 #include "chrome/browser/profiles/profile_info_cache.h" | 17 #include "chrome/browser/profiles/profile_info_cache.h" |
17 #include "chrome/browser/profiles/profile_manager.h" | 18 #include "chrome/browser/profiles/profile_manager.h" |
18 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 19 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
19 #include "chrome/browser/ui/app_list/app_list_service.h" | 20 #include "chrome/browser/ui/app_list/app_list_service.h" |
20 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 21 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 search_controller_->Start(); | 228 search_controller_->Start(); |
228 } | 229 } |
229 | 230 |
230 void AppListViewDelegate::StopSearch() { | 231 void AppListViewDelegate::StopSearch() { |
231 if (search_controller_) | 232 if (search_controller_) |
232 search_controller_->Stop(); | 233 search_controller_->Stop(); |
233 } | 234 } |
234 | 235 |
235 void AppListViewDelegate::OpenSearchResult( | 236 void AppListViewDelegate::OpenSearchResult( |
236 app_list::SearchResult* result, | 237 app_list::SearchResult* result, |
| 238 bool auto_launch, |
237 int event_flags) { | 239 int event_flags) { |
| 240 if (auto_launch) |
| 241 base::RecordAction(base::UserMetricsAction("AppList_AutoLaunched")); |
238 search_controller_->OpenResult(result, event_flags); | 242 search_controller_->OpenResult(result, event_flags); |
239 } | 243 } |
240 | 244 |
241 void AppListViewDelegate::InvokeSearchResultAction( | 245 void AppListViewDelegate::InvokeSearchResultAction( |
242 app_list::SearchResult* result, | 246 app_list::SearchResult* result, |
243 int action_index, | 247 int action_index, |
244 int event_flags) { | 248 int event_flags) { |
245 search_controller_->InvokeResultAction(result, action_index, event_flags); | 249 search_controller_->InvokeResultAction(result, action_index, event_flags); |
246 } | 250 } |
247 | 251 |
248 base::TimeDelta AppListViewDelegate::GetAutoLaunchTimeout() { | 252 base::TimeDelta AppListViewDelegate::GetAutoLaunchTimeout() { |
249 return auto_launch_timeout_; | 253 return auto_launch_timeout_; |
250 } | 254 } |
251 | 255 |
252 void AppListViewDelegate::AutoLaunchCanceled() { | 256 void AppListViewDelegate::AutoLaunchCanceled() { |
| 257 base::RecordAction(base::UserMetricsAction("AppList_AutoLaunchCanceled")); |
253 auto_launch_timeout_ = base::TimeDelta(); | 258 auto_launch_timeout_ = base::TimeDelta(); |
254 } | 259 } |
255 | 260 |
256 void AppListViewDelegate::ViewInitialized() { | 261 void AppListViewDelegate::ViewInitialized() { |
257 content::WebContents* contents = GetSpeechRecognitionContents(); | 262 content::WebContents* contents = GetSpeechRecognitionContents(); |
258 if (contents) { | 263 if (contents) { |
259 contents->GetWebUI()->CallJavascriptFunction( | 264 contents->GetWebUI()->CallJavascriptFunction( |
260 "appList.startPage.onAppListShown"); | 265 "appList.startPage.onAppListShown"); |
261 } | 266 } |
262 } | 267 } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 394 |
390 void AppListViewDelegate::AddObserver( | 395 void AppListViewDelegate::AddObserver( |
391 app_list::AppListViewDelegateObserver* observer) { | 396 app_list::AppListViewDelegateObserver* observer) { |
392 observers_.AddObserver(observer); | 397 observers_.AddObserver(observer); |
393 } | 398 } |
394 | 399 |
395 void AppListViewDelegate::RemoveObserver( | 400 void AppListViewDelegate::RemoveObserver( |
396 app_list::AppListViewDelegateObserver* observer) { | 401 app_list::AppListViewDelegateObserver* observer) { |
397 observers_.RemoveObserver(observer); | 402 observers_.RemoveObserver(observer); |
398 } | 403 } |
OLD | NEW |