Chromium Code Reviews| 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_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 206 | 206 |
| 207 // Returns the current autocomplete result. This logic should in the future | 207 // Returns the current autocomplete result. This logic should in the future |
| 208 // live in AutocompleteController but resides here for now. This method is | 208 // live in AutocompleteController but resides here for now. This method is |
| 209 // used by AutomationProvider::AutocompleteEditGetMatches. | 209 // used by AutomationProvider::AutocompleteEditGetMatches. |
| 210 const AutocompleteResult& result() const; | 210 const AutocompleteResult& result() const; |
| 211 | 211 |
| 212 // Called when the view is gaining focus. |control_down| is whether the | 212 // Called when the view is gaining focus. |control_down| is whether the |
| 213 // control key is down (at the time we're gaining focus). | 213 // control key is down (at the time we're gaining focus). |
| 214 void OnSetFocus(bool control_down); | 214 void OnSetFocus(bool control_down); |
| 215 | 215 |
| 216 // Called when we switch between using visible and invisible focus for the | |
| 217 // omnibox. NOTE: this does NOT convey whether the view currently has focus; | |
| 218 // only whether the focus will be visible when it does gain focus. | |
| 219 void OnFocusVisibilityChange(bool visible_focus); | |
|
Mathieu
2012/11/20 23:26:01
Again, *Changed may be better.
samarth
2012/11/21 00:40:15
Done.
| |
| 220 | |
| 216 // Sent before |OnKillFocus| and before the popup is closed. | 221 // Sent before |OnKillFocus| and before the popup is closed. |
| 217 void OnWillKillFocus(gfx::NativeView view_gaining_focus); | 222 void OnWillKillFocus(gfx::NativeView view_gaining_focus); |
| 218 | 223 |
| 219 // Called when the view is losing focus. Resets some state. | 224 // Called when the view is losing focus. Resets some state. |
| 220 void OnKillFocus(); | 225 void OnKillFocus(); |
| 221 | 226 |
| 222 // Called when the user presses the escape key. Decides what, if anything, to | 227 // Called when the user presses the escape key. Decides what, if anything, to |
| 223 // revert about any current edits. Returns whether the key was handled. | 228 // revert about any current edits. Returns whether the key was handled. |
| 224 bool OnEscapeKeyPressed(); | 229 bool OnEscapeKeyPressed(); |
| 225 | 230 |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 | 402 |
| 398 OmniboxView* view_; | 403 OmniboxView* view_; |
| 399 | 404 |
| 400 OmniboxPopupModel* popup_; | 405 OmniboxPopupModel* popup_; |
| 401 | 406 |
| 402 OmniboxEditController* controller_; | 407 OmniboxEditController* controller_; |
| 403 | 408 |
| 404 // Whether the edit has focus. | 409 // Whether the edit has focus. |
| 405 bool has_focus_; | 410 bool has_focus_; |
| 406 | 411 |
| 412 // Will the focus be visible? | |
| 413 bool focus_is_visible_; | |
| 414 | |
| 407 // The URL of the currently displayed page. | 415 // The URL of the currently displayed page. |
| 408 string16 permanent_text_; | 416 string16 permanent_text_; |
| 409 | 417 |
| 410 // This flag is true when the user has modified the contents of the edit, but | 418 // This flag is true when the user has modified the contents of the edit, but |
| 411 // not yet accepted them. We use this to determine when we need to save | 419 // not yet accepted them. We use this to determine when we need to save |
| 412 // state (on switching tabs) and whether changes to the page URL should be | 420 // state (on switching tabs) and whether changes to the page URL should be |
| 413 // immediately displayed. | 421 // immediately displayed. |
| 414 // This flag will be true in a superset of the cases where the popup is open. | 422 // This flag will be true in a superset of the cases where the popup is open. |
| 415 bool user_input_in_progress_; | 423 bool user_input_in_progress_; |
| 416 | 424 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 504 // an exact keyword match. If this is true then keyword mode will be | 512 // an exact keyword match. If this is true then keyword mode will be |
| 505 // triggered automatically if the input is "<keyword> <search string>". We | 513 // triggered automatically if the input is "<keyword> <search string>". We |
| 506 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. | 514 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. |
| 507 // This has no effect if we're already in keyword mode. | 515 // This has no effect if we're already in keyword mode. |
| 508 bool allow_exact_keyword_match_; | 516 bool allow_exact_keyword_match_; |
| 509 | 517 |
| 510 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); | 518 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); |
| 511 }; | 519 }; |
| 512 | 520 |
| 513 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 521 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
| OLD | NEW |