| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 } | 264 } |
| 265 | 265 |
| 266 void AppListViewDelegate::OpenFeedback() { | 266 void AppListViewDelegate::OpenFeedback() { |
| 267 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( | 267 chrome::HostDesktopType desktop = chrome::GetHostDesktopTypeForNativeWindow( |
| 268 controller_->GetAppListWindow()); | 268 controller_->GetAppListWindow()); |
| 269 Browser* browser = chrome::FindTabbedBrowser(profile_, false, desktop); | 269 Browser* browser = chrome::FindTabbedBrowser(profile_, false, desktop); |
| 270 chrome::ShowFeedbackPage(browser, std::string(), | 270 chrome::ShowFeedbackPage(browser, std::string(), |
| 271 chrome::kAppLauncherCategoryTag); | 271 chrome::kAppLauncherCategoryTag); |
| 272 } | 272 } |
| 273 | 273 |
| 274 void AppListViewDelegate::OnRightButtonClicked() { |
| 275 app_list::StartPageService* service = |
| 276 app_list::StartPageService::Get(profile_); |
| 277 if (service) |
| 278 service->ToggleSpeechRecognition(); |
| 279 } |
| 280 |
| 274 void AppListViewDelegate::ShowForProfileByPath( | 281 void AppListViewDelegate::ShowForProfileByPath( |
| 275 const base::FilePath& profile_path) { | 282 const base::FilePath& profile_path) { |
| 276 controller_->ShowForProfileByPath(profile_path); | 283 controller_->ShowForProfileByPath(profile_path); |
| 277 } | 284 } |
| 278 | 285 |
| 279 void AppListViewDelegate::OnSearch(const base::string16& query) { | 286 void AppListViewDelegate::OnSearch(const base::string16& query) { |
| 280 model_->search_box()->SetText(query); | 287 model_->search_box()->SetText(query); |
| 281 } | 288 } |
| 282 | 289 |
| 290 void AppListViewDelegate::OnSpeechRecognitionStateChanged(bool recognizing) { |
| 291 model_->search_box()->SetRightButtonState(recognizing); |
| 292 } |
| 293 |
| 283 void AppListViewDelegate::Observe( | 294 void AppListViewDelegate::Observe( |
| 284 int type, | 295 int type, |
| 285 const content::NotificationSource& source, | 296 const content::NotificationSource& source, |
| 286 const content::NotificationDetails& details) { | 297 const content::NotificationDetails& details) { |
| 287 OnProfileChanged(); | 298 OnProfileChanged(); |
| 288 } | 299 } |
| 289 | 300 |
| 290 void AppListViewDelegate::OnProfileAdded(const base::FilePath& profile_path) { | 301 void AppListViewDelegate::OnProfileAdded(const base::FilePath& profile_path) { |
| 291 OnProfileChanged(); | 302 OnProfileChanged(); |
| 292 } | 303 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 308 if (!service) | 319 if (!service) |
| 309 return NULL; | 320 return NULL; |
| 310 | 321 |
| 311 return service->contents(); | 322 return service->contents(); |
| 312 } | 323 } |
| 313 | 324 |
| 314 const app_list::AppListViewDelegate::Users& | 325 const app_list::AppListViewDelegate::Users& |
| 315 AppListViewDelegate::GetUsers() const { | 326 AppListViewDelegate::GetUsers() const { |
| 316 return users_; | 327 return users_; |
| 317 } | 328 } |
| OLD | NEW |