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

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

Issue 631913004: Open the launcher when hotword is triggered in always-on mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hotword-google-com-ntp
Patch Set: Created 6 years, 2 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 #ifndef CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ 5 #ifndef CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_
6 #define CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ 6 #define CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_
7 7
8 #include <list>
8 #include <vector> 9 #include <vector>
9 10
10 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/callback_forward.h"
tapted 2014/10/09 03:37:00 nit: pretty sure if you have a data member you "ne
Anand Mistry (off Chromium) 2014/10/13 21:52:00 Ah right. I put this in before I noticed that Call
11 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
13 #include "base/observer_list.h" 15 #include "base/observer_list.h"
14 #include "base/strings/string16.h" 16 #include "base/strings/string16.h"
15 #include "components/keyed_service/core/keyed_service.h" 17 #include "components/keyed_service/core/keyed_service.h"
16 #include "content/public/browser/web_contents.h" 18 #include "content/public/browser/web_contents.h"
17 #include "ui/app_list/speech_ui_model_observer.h" 19 #include "ui/app_list/speech_ui_model_observer.h"
18 20
19 namespace extensions { 21 namespace extensions {
20 class Extension; 22 class Extension;
(...skipping 15 matching lines...) Expand all
36 // Gets the instance for the given profile. 38 // Gets the instance for the given profile.
37 static StartPageService* Get(Profile* profile); 39 static StartPageService* Get(Profile* profile);
38 40
39 void AddObserver(StartPageObserver* observer); 41 void AddObserver(StartPageObserver* observer);
40 void RemoveObserver(StartPageObserver* observer); 42 void RemoveObserver(StartPageObserver* observer);
41 43
42 void AppListShown(); 44 void AppListShown();
43 void AppListHidden(); 45 void AppListHidden();
44 void ToggleSpeechRecognition(); 46 void ToggleSpeechRecognition();
45 47
48 // Called when the WebUI has finished loading.
49 void WebUILoaded();
50
46 // Returns true if the hotword is enabled in the app-launcher. 51 // Returns true if the hotword is enabled in the app-launcher.
47 bool HotwordEnabled(); 52 bool HotwordEnabled();
48 53
49 // They return essentially the same web contents but might return NULL when 54 // They return essentially the same web contents but might return NULL when
50 // some flag disables the feature. 55 // some flag disables the feature.
51 content::WebContents* GetStartPageContents(); 56 content::WebContents* GetStartPageContents();
52 content::WebContents* GetSpeechRecognitionContents(); 57 content::WebContents* GetSpeechRecognitionContents();
53 58
54 RecommendedApps* recommended_apps() { return recommended_apps_.get(); } 59 RecommendedApps* recommended_apps() { return recommended_apps_.get(); }
55 Profile* profile() { return profile_; } 60 Profile* profile() { return profile_; }
(...skipping 26 matching lines...) Expand all
82 Profile* profile_; 87 Profile* profile_;
83 scoped_ptr<content::WebContents> contents_; 88 scoped_ptr<content::WebContents> contents_;
84 scoped_ptr<StartPageWebContentsDelegate> contents_delegate_; 89 scoped_ptr<StartPageWebContentsDelegate> contents_delegate_;
85 scoped_ptr<ProfileDestroyObserver> profile_destroy_observer_; 90 scoped_ptr<ProfileDestroyObserver> profile_destroy_observer_;
86 scoped_ptr<RecommendedApps> recommended_apps_; 91 scoped_ptr<RecommendedApps> recommended_apps_;
87 SpeechRecognitionState state_; 92 SpeechRecognitionState state_;
88 ObserverList<StartPageObserver> observers_; 93 ObserverList<StartPageObserver> observers_;
89 bool speech_button_toggled_manually_; 94 bool speech_button_toggled_manually_;
90 bool speech_result_obtained_; 95 bool speech_result_obtained_;
91 96
97 bool webui_finished_loading_;
98 std::list<base::Closure> pending_webui_callbacks_;
Matt Giuca 2014/10/09 18:07:12 Is there a reason to use list over vector? I've ne
Anand Mistry (off Chromium) 2014/10/13 21:52:00 In this particular case, it doesn't matter since t
99
92 DISALLOW_COPY_AND_ASSIGN(StartPageService); 100 DISALLOW_COPY_AND_ASSIGN(StartPageService);
93 }; 101 };
94 102
95 } // namespace app_list 103 } // namespace app_list
96 104
97 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_ 105 #endif // CHROME_BROWSER_UI_APP_LIST_START_PAGE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698