| 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 16 matching lines...) Expand all Loading... |
| 27 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 27 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 28 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 28 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
| 29 #include "chrome/browser/web_applications/web_app.h" | 29 #include "chrome/browser/web_applications/web_app.h" |
| 30 #include "chrome/common/extensions/extension_constants.h" | 30 #include "chrome/common/extensions/extension_constants.h" |
| 31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
| 32 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
| 33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
| 34 #include "content/public/browser/notification_source.h" | 34 #include "content/public/browser/notification_source.h" |
| 35 #include "content/public/browser/page_navigator.h" | 35 #include "content/public/browser/page_navigator.h" |
| 36 #include "content/public/browser/user_metrics.h" | 36 #include "content/public/browser/user_metrics.h" |
| 37 #include "grit/theme_resources.h" |
| 37 #include "ui/app_list/app_list_switches.h" | 38 #include "ui/app_list/app_list_switches.h" |
| 38 #include "ui/app_list/app_list_view_delegate_observer.h" | 39 #include "ui/app_list/app_list_view_delegate_observer.h" |
| 39 #include "ui/app_list/search_box_model.h" | 40 #include "ui/app_list/search_box_model.h" |
| 40 #include "ui/app_list/speech_ui_model.h" | 41 #include "ui/app_list/speech_ui_model.h" |
| 42 #include "ui/base/resource/resource_bundle.h" |
| 41 | 43 |
| 42 #if defined(USE_ASH) | 44 #if defined(USE_ASH) |
| 43 #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" |
| 44 #endif | 46 #endif |
| 45 | 47 |
| 46 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
| 47 #include "chrome/browser/web_applications/web_app_win.h" | 49 #include "chrome/browser/web_applications/web_app_win.h" |
| 48 #endif | 50 #endif |
| 49 | 51 |
| 50 namespace { | 52 namespace { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 103 |
| 102 // Hotword listening is on by default in ChromeOS right now. Here shouldn't | 104 // Hotword listening is on by default in ChromeOS right now. Here shouldn't |
| 103 // use the current state in the webui because it will be changed to 'hotword | 105 // use the current state in the webui because it will be changed to 'hotword |
| 104 // listening' state from 'ready' after the view is initialized. | 106 // listening' state from 'ready' after the view is initialized. |
| 105 speech_ui_.reset(new app_list::SpeechUIModel( | 107 speech_ui_.reset(new app_list::SpeechUIModel( |
| 106 #if defined(OS_CHROMEOS) | 108 #if defined(OS_CHROMEOS) |
| 107 app_list::switches::IsVoiceSearchEnabled() ? | 109 app_list::switches::IsVoiceSearchEnabled() ? |
| 108 app_list::SPEECH_RECOGNITION_HOTWORD_LISTENING : | 110 app_list::SPEECH_RECOGNITION_HOTWORD_LISTENING : |
| 109 #endif | 111 #endif |
| 110 app_list::SPEECH_RECOGNITION_OFF)); | 112 app_list::SPEECH_RECOGNITION_OFF)); |
| 113 |
| 114 #if defined(GOOGLE_CHROME_BUILD) |
| 115 speech_ui_->set_logo( |
| 116 *ui::ResourceBundle::GetSharedInstance(). |
| 117 GetImageSkiaNamed(IDR_APP_LIST_GOOGLE_LOGO_VOICE_SEARCH)); |
| 118 #endif |
| 111 } | 119 } |
| 112 | 120 |
| 113 AppListViewDelegate::~AppListViewDelegate() { | 121 AppListViewDelegate::~AppListViewDelegate() { |
| 114 app_list::StartPageService* service = | 122 app_list::StartPageService* service = |
| 115 app_list::StartPageService::Get(profile_); | 123 app_list::StartPageService::Get(profile_); |
| 116 if (service) | 124 if (service) |
| 117 service->RemoveObserver(this); | 125 service->RemoveObserver(this); |
| 118 g_browser_process-> | 126 g_browser_process-> |
| 119 profile_manager()->GetProfileInfoCache().RemoveObserver(this); | 127 profile_manager()->GetProfileInfoCache().RemoveObserver(this); |
| 120 } | 128 } |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 | 393 |
| 386 void AppListViewDelegate::AddObserver( | 394 void AppListViewDelegate::AddObserver( |
| 387 app_list::AppListViewDelegateObserver* observer) { | 395 app_list::AppListViewDelegateObserver* observer) { |
| 388 observers_.AddObserver(observer); | 396 observers_.AddObserver(observer); |
| 389 } | 397 } |
| 390 | 398 |
| 391 void AppListViewDelegate::RemoveObserver( | 399 void AppListViewDelegate::RemoveObserver( |
| 392 app_list::AppListViewDelegateObserver* observer) { | 400 app_list::AppListViewDelegateObserver* observer) { |
| 393 observers_.RemoveObserver(observer); | 401 observers_.RemoveObserver(observer); |
| 394 } | 402 } |
| OLD | NEW |