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

Side by Side Diff: chrome/browser/ui/app_list/start_page_service.cc

Issue 186483004: Add a skeleton Start Page to the experimental app list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ares_change_experimental_animation
Patch Set: Created 6 years, 9 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/start_page_service.h" 5 #include "chrome/browser/ui/app_list/start_page_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 observers_.RemoveObserver(observer); 137 observers_.RemoveObserver(observer);
138 } 138 }
139 139
140 void StartPageService::ToggleSpeechRecognition() { 140 void StartPageService::ToggleSpeechRecognition() {
141 speech_button_toggled_manually_ = true; 141 speech_button_toggled_manually_ = true;
142 contents_->GetWebUI()->CallJavascriptFunction( 142 contents_->GetWebUI()->CallJavascriptFunction(
143 "appList.startPage.toggleSpeechRecognition"); 143 "appList.startPage.toggleSpeechRecognition");
144 } 144 }
145 145
146 content::WebContents* StartPageService::GetStartPageContents() { 146 content::WebContents* StartPageService::GetStartPageContents() {
147 return CommandLine::ForCurrentProcess()->HasSwitch( 147 return (app_list::switches::IsExperimentalAppListEnabled() ||
148 ::switches::kShowAppListStartPage) ? contents_.get() : NULL; 148 app_list::switches::IsExperimentalAppListEnabled()) ? contents_.get()
tapted 2014/03/10 02:41:54 Do you still need to handle the "old" start page f
calamity 2014/03/14 07:50:02 xiyuan@ said that he's fine with changing the star
xiyuan 2014/03/14 17:00:54 The last I talked to Alex, my impression is that w
149 : NULL;
149 } 150 }
150 151
151 content::WebContents* StartPageService::GetSpeechRecognitionContents() { 152 content::WebContents* StartPageService::GetSpeechRecognitionContents() {
152 return app_list::switches::IsVoiceSearchEnabled() ? contents_.get() : NULL; 153 return app_list::switches::IsVoiceSearchEnabled() ? contents_.get() : NULL;
153 } 154 }
154 155
155 void StartPageService::OnSpeechResult( 156 void StartPageService::OnSpeechResult(
156 const base::string16& query, bool is_final) { 157 const base::string16& query, bool is_final) {
157 if (is_final) { 158 if (is_final) {
158 speech_result_obtained_ = true; 159 speech_result_obtained_ = true;
(...skipping 29 matching lines...) Expand all
188 FOR_EACH_OBSERVER(StartPageObserver, 189 FOR_EACH_OBSERVER(StartPageObserver,
189 observers_, 190 observers_,
190 OnSpeechRecognitionStateChanged(new_state)); 191 OnSpeechRecognitionStateChanged(new_state));
191 } 192 }
192 193
193 void StartPageService::Shutdown() { 194 void StartPageService::Shutdown() {
194 contents_.reset(); 195 contents_.reset();
195 } 196 }
196 197
197 } // namespace app_list 198 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698