Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Unified Diff: chrome/browser/ui/app_list/search/search_controller.cc

Issue 69813002: Adds the speech recognition button to the app-list searchbox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/search/search_controller.cc
diff --git a/chrome/browser/ui/app_list/search/search_controller.cc b/chrome/browser/ui/app_list/search/search_controller.cc
index d10756a4892ea0ae8430055d4295afdcf152bc85..1da1e94972ca0c4779b3989d0cd6a5e5cb7b9b25 100644
--- a/chrome/browser/ui/app_list/search/search_controller.cc
+++ b/chrome/browser/ui/app_list/search/search_controller.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/ui/app_list/search/people/people_provider.h"
#include "chrome/browser/ui/app_list/search/search_provider.h"
#include "chrome/browser/ui/app_list/search/webstore/webstore_provider.h"
+#include "chrome/browser/ui/app_list/start_page_service.h"
#include "chrome/common/chrome_switches.h"
#include "content/public/browser/user_metrics.h"
#include "grit/generated_resources.h"
@@ -53,10 +54,20 @@ SearchController::SearchController(Profile* profile,
SearchController::~SearchController() {}
void SearchController::Init() {
+ ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
search_box_->SetHintText(
l10n_util::GetStringUTF16(IDS_SEARCH_BOX_HINT));
- search_box_->SetIcon(*ui::ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_OMNIBOX_SEARCH));
+ search_box_->SetIcon(*bundle.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH));
+ if (StartPageService::Get(profile_)) {
+ search_box_->SetRightButton(scoped_ptr<SearchBoxModel::RightButtonProperty>(
+ new SearchBoxModel::RightButtonProperty(
+ // Right now provides the same image for both state.
+ // TODO(mukai, jennschen): Replace them by the real images.
+ *bundle.GetImageSkiaNamed(IDR_OMNIBOX_MIC_SEARCH),
+ *bundle.GetImageSkiaNamed(IDR_OMNIBOX_MIC_SEARCH),
+ l10n_util::GetStringUTF16(IDS_APP_LIST_START_SPEECH_RECOGNITION),
+ l10n_util::GetStringUTF16(IDS_APP_LIST_STOP_SPEECH_RECOGNITION))));
+ }
mixer_->Init();

Powered by Google App Engine
This is Rietveld 408576698