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

Unified Diff: chrome/browser/ui/search/search_model.h

Issue 17132011: Add setVoiceSearchSupported to the searchbox API. This will be used to determine whether to show a … (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Move listener to SearchTabHelper. Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/search/search_model.h
diff --git a/chrome/browser/ui/search/search_model.h b/chrome/browser/ui/search/search_model.h
index 3f77b87c17383018f30bb64433abb9607f5d3ed1..5510c240a0af7f3083386246445ac04ca83d0677 100644
--- a/chrome/browser/ui/search/search_model.h
+++ b/chrome/browser/ui/search/search_model.h
@@ -16,20 +16,21 @@ class SearchModelObserver;
class SearchModel {
public:
struct State {
- State() : top_bars_visible(true) {}
- State(const SearchMode& mode, bool top_bars_visible)
- : mode(mode),
- top_bars_visible(top_bars_visible) {}
+ State();
+ State(const SearchMode& mode,
+ bool top_bars_visible,
+ bool voice_search_supported);
- bool operator==(const State& rhs) const {
- return mode == rhs.mode && top_bars_visible == rhs.top_bars_visible;
- }
+ bool operator==(const State& rhs) const;
// The display mode of UI elements such as the toolbar, the tab strip, etc.
SearchMode mode;
// The visibility of top bars such as bookmark and info bars.
bool top_bars_visible;
+
+ // Whether the page supports voice search.
+ bool voice_search_supported;
};
SearchModel();
@@ -55,6 +56,13 @@ class SearchModel {
// Set visibility of top bars. Change notifications are sent to observers.
void SetTopBarsVisible(bool visible);
+ // Sets the page voice search support state. Change notifications are sent to
+ // observers.
+ void SetVoiceSearchSupported(bool supported);
+
+ // Gets the voice search support state of the page.
+ bool voice_search_supported() const { return state_.voice_search_supported; }
+
// Get the visibility of top bars.
bool top_bars_visible() const { return state_.top_bars_visible; }

Powered by Google App Engine
This is Rietveld 408576698