OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_INSTANT_INSTANT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 | 79 |
80 // If the preview is showing search results, commits the preview, calling | 80 // If the preview is showing search results, commits the preview, calling |
81 // CommitInstant() on the browser, and returns true. Else, returns false. | 81 // CommitInstant() on the browser, and returns true. Else, returns false. |
82 bool CommitIfCurrent(InstantCommitType type); | 82 bool CommitIfCurrent(InstantCommitType type); |
83 | 83 |
84 // The omnibox has lost focus. Commit or discard the preview accordingly. | 84 // The omnibox has lost focus. Commit or discard the preview accordingly. |
85 void OmniboxLostFocus(gfx::NativeView view_gaining_focus); | 85 void OmniboxLostFocus(gfx::NativeView view_gaining_focus); |
86 | 86 |
87 // The omnibox has gained focus. Preload the default search engine, in | 87 // The omnibox has gained focus. Preload the default search engine, in |
88 // anticipation of the user typing a query. | 88 // anticipation of the user typing a query. |
89 void OmniboxGotFocus(); | 89 void OmniboxGotFocus(bool focus_is_visible); |
90 | 90 |
91 // The search mode in the active tab has changed. Pass the message down to | 91 // The search mode in the active tab has changed. Pass the message down to |
92 // the loader which will notify the renderer. | 92 // the loader which will notify the renderer. |
93 void SearchModeChanged(const chrome::search::Mode& old_mode, | 93 void SearchModeChanged(const chrome::search::Mode& old_mode, |
94 const chrome::search::Mode& new_mode); | 94 const chrome::search::Mode& new_mode); |
95 | 95 |
96 // The user switched tabs. Hide the preview if needed. | 96 // The user switched tabs. Hide the preview if needed. |
97 void ActiveTabChanged(); | 97 void ActiveTabChanged(); |
98 | 98 |
99 // Sets whether Instant should show result previews. | 99 // Sets whether Instant should show result previews. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 | 216 |
217 // See comments on the getter above. | 217 // See comments on the getter above. |
218 content::PageTransition last_transition_type_; | 218 content::PageTransition last_transition_type_; |
219 | 219 |
220 // True if the last match passed to Update() was a search (versus a URL). | 220 // True if the last match passed to Update() was a search (versus a URL). |
221 bool last_match_was_search_; | 221 bool last_match_was_search_; |
222 | 222 |
223 // True if the omnibox is focused, false otherwise. | 223 // True if the omnibox is focused, false otherwise. |
224 bool is_omnibox_focused_; | 224 bool is_omnibox_focused_; |
225 | 225 |
226 // True iff the omnibox is invisibly focused. Never true if is_omnibox_focused | |
227 // is false. | |
228 bool is_omnibox_invisibly_focused_; | |
Jered
2012/11/28 17:50:16
Would it make sense to have a single enum here, li
samarth
2012/11/28 19:33:09
We could do that. The downside is that just check
Jered
2012/11/28 19:56:57
I think we could just say: omnibox_focus_type_ !=
samarth
2012/11/28 22:08:11
Duh, you're right. Done.
| |
229 | |
226 // The search model mode for the active tab. | 230 // The search model mode for the active tab. |
227 chrome::search::Mode search_mode_; | 231 chrome::search::Mode search_mode_; |
228 | 232 |
229 // Current omnibox bounds. | 233 // Current omnibox bounds. |
230 gfx::Rect omnibox_bounds_; | 234 gfx::Rect omnibox_bounds_; |
231 | 235 |
232 // Last bounds passed to the page. | 236 // Last bounds passed to the page. |
233 gfx::Rect last_omnibox_bounds_; | 237 gfx::Rect last_omnibox_bounds_; |
234 | 238 |
235 // Timer used to update the bounds of the omnibox. | 239 // Timer used to update the bounds of the omnibox. |
(...skipping 17 matching lines...) Expand all Loading... | |
253 | 257 |
254 // The timestamp at which query editing began. This value is used when the | 258 // The timestamp at which query editing began. This value is used when the |
255 // first set of suggestions is processed and cleared when the overlay is | 259 // first set of suggestions is processed and cleared when the overlay is |
256 // hidden. | 260 // hidden. |
257 base::Time first_interaction_time_; | 261 base::Time first_interaction_time_; |
258 | 262 |
259 DISALLOW_COPY_AND_ASSIGN(InstantController); | 263 DISALLOW_COPY_AND_ASSIGN(InstantController); |
260 }; | 264 }; |
261 | 265 |
262 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ | 266 #endif // CHROME_BROWSER_INSTANT_INSTANT_CONTROLLER_H_ |
OLD | NEW |