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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 // may be false when the user is composing a text with an IME. | 290 // may be false when the user is composing a text with an IME. |
| 291 bool OnAfterPossibleChange(const string16& old_text, | 291 bool OnAfterPossibleChange(const string16& old_text, |
| 292 const string16& new_text, | 292 const string16& new_text, |
| 293 size_t selection_start, | 293 size_t selection_start, |
| 294 size_t selection_end, | 294 size_t selection_end, |
| 295 bool selection_differs, | 295 bool selection_differs, |
| 296 bool text_differs, | 296 bool text_differs, |
| 297 bool just_deleted_text, | 297 bool just_deleted_text, |
| 298 bool allow_keyword_ui_change); | 298 bool allow_keyword_ui_change); |
| 299 | 299 |
| 300 // TODO(beaudoin): Mac code still calls this here. We should try to untangle | |
| 301 // this. | |
| 302 // Invoked when the popup has changed its bounds to |bounds|. |bounds| here | |
| 303 // is in screen coordinates. | |
| 304 void OnPopupBoundsChanged(const gfx::Rect& bounds) { | |
| 305 omnibox_controller_->OnPopupBoundsChanged(bounds); | |
| 306 } | |
| 307 | |
| 308 // Called when the current match has changed in the OmniboxController. | 300 // Called when the current match has changed in the OmniboxController. |
| 309 void OnCurrentMatchChanged(bool is_temporary_set_by_instant); | 301 void OnCurrentMatchChanged(bool is_temporary_set_by_instant); |
|
Peter Kasting
2013/06/28 18:47:55
This function is now never called with its arg set
Jered
2013/06/28 19:09:55
Done.
| |
| 310 | 302 |
| 311 // Callend when the gray text suggestion has changed in the OmniboxController. | 303 // Callend when the gray text suggestion has changed in the OmniboxController. |
| 312 void OnGrayTextChanged(); | 304 void OnGrayTextChanged(); |
|
Peter Kasting
2013/06/28 18:47:55
This function now has no callers, should it be del
Jered
2013/06/28 19:09:55
Done.
| |
| 313 | 305 |
| 314 // Access the current view text. | 306 // Access the current view text. |
| 315 string16 GetViewText() const; | 307 string16 GetViewText() const; |
| 316 | 308 |
| 317 string16 user_text() const { return user_text_; } | 309 string16 user_text() const { return user_text_; } |
| 318 | 310 |
| 319 // TODO(beaudoin): We need this to allow OmniboxController access the | 311 // TODO(beaudoin): We need this to allow OmniboxController access the |
| 320 // InstantController via OmniboxEditController, because the only valid pointer | 312 // InstantController via OmniboxEditController, because the only valid pointer |
| 321 // to InstantController is kept in Browser. We should try to get rid of this, | 313 // to InstantController is kept in Browser. We should try to get rid of this, |
| 322 // maybe by ensuring InstantController lives as long as Browser. | 314 // maybe by ensuring InstantController lives as long as Browser. |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 496 // due to the user arrowing up/down through the popup. This can only be true | 488 // due to the user arrowing up/down through the popup. This can only be true |
| 497 // if |has_temporary_text_| is true. | 489 // if |has_temporary_text_| is true. |
| 498 // TODO(sreeram): This is a temporary hack. Remove it once the omnibox edit | 490 // TODO(sreeram): This is a temporary hack. Remove it once the omnibox edit |
| 499 // model/view code is decoupled from Instant (among other things). | 491 // model/view code is decoupled from Instant (among other things). |
| 500 bool is_temporary_text_set_by_instant_; | 492 bool is_temporary_text_set_by_instant_; |
| 501 | 493 |
| 502 // The index of the selected AutocompleteMatch in AutocompleteResult. This is | 494 // The index of the selected AutocompleteMatch in AutocompleteResult. This is |
| 503 // needed to get the metadata details of the temporary text set by instant on | 495 // needed to get the metadata details of the temporary text set by instant on |
| 504 // the Local NTP. If the Instant extended is disabled or an Instant NTP is | 496 // the Local NTP. If the Instant extended is disabled or an Instant NTP is |
| 505 // used, this is set to OmniboxPopupModel::kNoMatch. | 497 // used, this is set to OmniboxPopupModel::kNoMatch. |
| 506 size_t selected_instant_autocomplete_match_index_; | 498 size_t selected_instant_autocomplete_match_index_; |
|
Peter Kasting
2013/06/28 18:47:55
AFAICT, this variable and the next are never true.
Jered
2013/06/28 19:09:55
Done.
| |
| 507 | 499 |
| 508 // True if the current temporary text set by Instant is a search query; false | 500 // True if the current temporary text set by Instant is a search query; false |
| 509 // if it is a URL that can be directly navigated to. This is only valid if | 501 // if it is a URL that can be directly navigated to. This is only valid if |
| 510 // |is_temporary_text_set_by_instant_| is true. This field is needed because | 502 // |is_temporary_text_set_by_instant_| is true. This field is needed because |
| 511 // Instant's temporary text doesn't come from the popup model, so we can't | 503 // Instant's temporary text doesn't come from the popup model, so we can't |
| 512 // lookup its type from the current match. | 504 // lookup its type from the current match. |
| 513 bool is_instant_temporary_text_a_search_query_; | 505 bool is_instant_temporary_text_a_search_query_; |
| 514 | 506 |
| 515 // When the user's last action was to paste, we disallow inline autocomplete | 507 // When the user's last action was to paste, we disallow inline autocomplete |
| 516 // (on the theory that the user is trying to paste in a new URL or part of | 508 // (on the theory that the user is trying to paste in a new URL or part of |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 561 // an exact keyword match. If this is true then keyword mode will be | 553 // an exact keyword match. If this is true then keyword mode will be |
| 562 // triggered automatically if the input is "<keyword> <search string>". We | 554 // triggered automatically if the input is "<keyword> <search string>". We |
| 563 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. | 555 // allow this when CreatedKeywordSearchByInsertingSpaceInMiddle() is true. |
| 564 // This has no effect if we're already in keyword mode. | 556 // This has no effect if we're already in keyword mode. |
| 565 bool allow_exact_keyword_match_; | 557 bool allow_exact_keyword_match_; |
| 566 | 558 |
| 567 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); | 559 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); |
| 568 }; | 560 }; |
| 569 | 561 |
| 570 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ | 562 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_MODEL_H_ |
| OLD | NEW |