| 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" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #if defined(USE_ASH) | 44 #if defined(USE_ASH) |
| 45 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" | 45 #include "chrome/browser/ui/ash/app_list/app_sync_ui_state_watcher.h" |
| 46 #endif | 46 #endif |
| 47 | 47 |
| 48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 49 #include "chrome/browser/web_applications/web_app_win.h" | 49 #include "chrome/browser/web_applications/web_app_win.h" |
| 50 #endif | 50 #endif |
| 51 | 51 |
| 52 namespace { | 52 namespace { |
| 53 | 53 |
| 54 const int kAutoLaunchDefaultTimeoutSec = 3; | 54 const int kAutoLaunchDefaultTimeoutMilliSec = 50; |
| 55 | 55 |
| 56 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
| 57 void CreateShortcutInWebAppDir( | 57 void CreateShortcutInWebAppDir( |
| 58 const base::FilePath& app_data_dir, | 58 const base::FilePath& app_data_dir, |
| 59 base::Callback<void(const base::FilePath&)> callback, | 59 base::Callback<void(const base::FilePath&)> callback, |
| 60 const ShellIntegration::ShortcutInfo& info) { | 60 const ShellIntegration::ShortcutInfo& info) { |
| 61 content::BrowserThread::PostTaskAndReplyWithResult( | 61 content::BrowserThread::PostTaskAndReplyWithResult( |
| 62 content::BrowserThread::FILE, | 62 content::BrowserThread::FILE, |
| 63 FROM_HERE, | 63 FROM_HERE, |
| 64 base::Bind(web_app::CreateShortcutInWebAppDir, app_data_dir, info), | 64 base::Bind(web_app::CreateShortcutInWebAppDir, app_data_dir, info), |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 325 |
| 326 void AppListViewDelegate::ShowForProfileByPath( | 326 void AppListViewDelegate::ShowForProfileByPath( |
| 327 const base::FilePath& profile_path) { | 327 const base::FilePath& profile_path) { |
| 328 controller_->ShowForProfileByPath(profile_path); | 328 controller_->ShowForProfileByPath(profile_path); |
| 329 } | 329 } |
| 330 | 330 |
| 331 void AppListViewDelegate::OnSpeechResult(const base::string16& result, | 331 void AppListViewDelegate::OnSpeechResult(const base::string16& result, |
| 332 bool is_final) { | 332 bool is_final) { |
| 333 speech_ui_->SetSpeechResult(result, is_final); | 333 speech_ui_->SetSpeechResult(result, is_final); |
| 334 if (is_final) { | 334 if (is_final) { |
| 335 auto_launch_timeout_ = base::TimeDelta::FromSeconds( | 335 auto_launch_timeout_ = base::TimeDelta::FromMilliseconds( |
| 336 kAutoLaunchDefaultTimeoutSec); | 336 kAutoLaunchDefaultTimeoutMilliSec); |
| 337 model_->search_box()->SetText(result); | 337 model_->search_box()->SetText(result); |
| 338 } | 338 } |
| 339 } | 339 } |
| 340 | 340 |
| 341 void AppListViewDelegate::OnSpeechSoundLevelChanged(int16 level) { | 341 void AppListViewDelegate::OnSpeechSoundLevelChanged(int16 level) { |
| 342 speech_ui_->UpdateSoundLevel(level); | 342 speech_ui_->UpdateSoundLevel(level); |
| 343 } | 343 } |
| 344 | 344 |
| 345 void AppListViewDelegate::OnSpeechRecognitionStateChanged( | 345 void AppListViewDelegate::OnSpeechRecognitionStateChanged( |
| 346 app_list::SpeechRecognitionState new_state) { | 346 app_list::SpeechRecognitionState new_state) { |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 | 394 |
| 395 void AppListViewDelegate::AddObserver( | 395 void AppListViewDelegate::AddObserver( |
| 396 app_list::AppListViewDelegateObserver* observer) { | 396 app_list::AppListViewDelegateObserver* observer) { |
| 397 observers_.AddObserver(observer); | 397 observers_.AddObserver(observer); |
| 398 } | 398 } |
| 399 | 399 |
| 400 void AppListViewDelegate::RemoveObserver( | 400 void AppListViewDelegate::RemoveObserver( |
| 401 app_list::AppListViewDelegateObserver* observer) { | 401 app_list::AppListViewDelegateObserver* observer) { |
| 402 observers_.RemoveObserver(observer); | 402 observers_.RemoveObserver(observer); |
| 403 } | 403 } |
| OLD | NEW |