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

Side by Side Diff: chrome/browser/ui/webui/app_list/start_page_handler.cc

Issue 204703002: Rename NOTIFICATION_EXTENSION_UNLOADED to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maybe upload wont do something bizarre this time 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 | Annotate | Revision Log
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/webui/app_list/start_page_handler.h" 5 #include "chrome/browser/ui/webui/app_list/start_page_handler.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 DCHECK_EQ(Profile::FromWebUI(web_ui()), 105 DCHECK_EQ(Profile::FromWebUI(web_ui()),
106 content::Source<Profile>(source).ptr()); 106 content::Source<Profile>(source).ptr());
107 switch (type) { 107 switch (type) {
108 case chrome::NOTIFICATION_EXTENSION_LOADED: { 108 case chrome::NOTIFICATION_EXTENSION_LOADED: {
109 extensions::Extension* extension = 109 extensions::Extension* extension =
110 content::Details<extensions::Extension>(details).ptr(); 110 content::Details<extensions::Extension>(details).ptr();
111 if (extension->id() == extension_misc::kHotwordExtensionId) 111 if (extension->id() == extension_misc::kHotwordExtensionId)
112 OnHotwordEnabledChanged(); 112 OnHotwordEnabledChanged();
113 break; 113 break;
114 } 114 }
115 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { 115 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: {
116 extensions::UnloadedExtensionInfo* info = 116 extensions::UnloadedExtensionInfo* info =
117 content::Details<extensions::UnloadedExtensionInfo>(details).ptr(); 117 content::Details<extensions::UnloadedExtensionInfo>(details).ptr();
118 if (info->extension->id() == extension_misc::kHotwordExtensionId) 118 if (info->extension->id() == extension_misc::kHotwordExtensionId)
119 OnHotwordEnabledChanged(); 119 OnHotwordEnabledChanged();
120 break; 120 break;
121 } 121 }
122 default: 122 default:
123 NOTREACHED(); 123 NOTREACHED();
124 break; 124 break;
125 } 125 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 if (app_list::switches::IsVoiceSearchEnabled() && 206 if (app_list::switches::IsVoiceSearchEnabled() &&
207 HotwordService::DoesHotwordSupportLanguage(profile)) { 207 HotwordService::DoesHotwordSupportLanguage(profile)) {
208 OnHotwordEnabledChanged(); 208 OnHotwordEnabledChanged();
209 pref_change_registrar_.Init(profile->GetPrefs()); 209 pref_change_registrar_.Init(profile->GetPrefs());
210 pref_change_registrar_.Add( 210 pref_change_registrar_.Add(
211 prefs::kHotwordSearchEnabled, 211 prefs::kHotwordSearchEnabled,
212 base::Bind(&StartPageHandler::OnHotwordEnabledChanged, 212 base::Bind(&StartPageHandler::OnHotwordEnabledChanged,
213 base::Unretained(this))); 213 base::Unretained(this)));
214 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, 214 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
215 content::Source<Profile>(profile)); 215 content::Source<Profile>(profile));
216 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 216 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
217 content::Source<Profile>(profile)); 217 content::Source<Profile>(profile));
218 hotword_monitor_.reset(new HotwordBackgroundActivityMonitor(this)); 218 hotword_monitor_.reset(new HotwordBackgroundActivityMonitor(this));
219 } 219 }
220 #endif 220 #endif
221 } 221 }
222 222
223 bool StartPageHandler::ShouldRunHotwordBackground() { 223 bool StartPageHandler::ShouldRunHotwordBackground() {
224 return has_hotword_recognizer_ && switches::IsHotwordAlwaysOnEnabled() && 224 return has_hotword_recognizer_ && switches::IsHotwordAlwaysOnEnabled() &&
225 hotword_monitor_ && hotword_monitor_->IsHotwordBackgroundActive(); 225 hotword_monitor_ && hotword_monitor_->IsHotwordBackgroundActive();
226 } 226 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 if (service) 299 if (service)
300 service->OnSpeechRecognitionStateChanged(new_state); 300 service->OnSpeechRecognitionStateChanged(new_state);
301 301
302 if (new_state == SPEECH_RECOGNITION_READY && ShouldRunHotwordBackground()) { 302 if (new_state == SPEECH_RECOGNITION_READY && ShouldRunHotwordBackground()) {
303 web_ui()->CallJavascriptFunction( 303 web_ui()->CallJavascriptFunction(
304 "appList.startPage.startHotwordRecognition"); 304 "appList.startPage.startHotwordRecognition");
305 } 305 }
306 } 306 }
307 307
308 } // namespace app_list 308 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | chrome/browser/ui/webui/extensions/command_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698