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

Side by Side Diff: components/omnibox/browser/omnibox_edit_model.h

Issue 1943683002: Refactor OmniboxEditModel::user_text_ to not include keyword (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test coverage & refactor Created 4 years, 7 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 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 COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_
6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ 6 #define COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 381
382 // Called whenever user_text_ should change. 382 // Called whenever user_text_ should change.
383 void InternalSetUserText(const base::string16& text); 383 void InternalSetUserText(const base::string16& text);
384 384
385 // Turns off keyword mode for the current match. 385 // Turns off keyword mode for the current match.
386 void ClearPopupKeywordMode() const; 386 void ClearPopupKeywordMode() const;
387 387
388 // Conversion between user text and display text. User text is the text the 388 // Conversion between user text and display text. User text is the text the
389 // user has input. Display text is the text being shown in the edit. The 389 // user has input. Display text is the text being shown in the edit. The
390 // two are different if a keyword is selected. 390 // two are different if a keyword is selected.
391 base::string16 DisplayTextFromUserText(const base::string16& text) const; 391 base::string16 MaybeStripKeyword(const base::string16& text) const;
392 base::string16 UserTextFromDisplayText(const base::string16& text) const; 392 base::string16 MaybePrependKeyword(const base::string16& text) const;
393 393
394 // If there's a selected match, copies it into |match|. Else, returns the 394 // If there's a selected match, copies it into |match|. Else, returns the
395 // default match for the current text, as well as the alternate nav URL, if 395 // default match for the current text, as well as the alternate nav URL, if
396 // |alternate_nav_url| is non-NULL and there is such a URL. 396 // |alternate_nav_url| is non-NULL and there is such a URL.
397 void GetInfoForCurrentText(AutocompleteMatch* match, 397 void GetInfoForCurrentText(AutocompleteMatch* match,
398 GURL* alternate_nav_url) const; 398 GURL* alternate_nav_url) const;
399 399
400 // Reverts the edit box from a temporary text back to the original user text. 400 // Reverts the edit box from a temporary text back to the original user text.
401 // If |revert_popup| is true then the popup will be reverted as well. 401 // If |revert_popup| is true then the popup will be reverted as well.
402 void RevertTemporaryText(bool revert_popup); 402 void RevertTemporaryText(bool revert_popup);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 560
561 // The input that was sent to the AutocompleteController. Since no 561 // The input that was sent to the AutocompleteController. Since no
562 // autocomplete query is started after a tab switch, it is possible for this 562 // autocomplete query is started after a tab switch, it is possible for this
563 // |input_| to differ from the one currently stored in AutocompleteController. 563 // |input_| to differ from the one currently stored in AutocompleteController.
564 AutocompleteInput input_; 564 AutocompleteInput input_;
565 565
566 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel); 566 DISALLOW_COPY_AND_ASSIGN(OmniboxEditModel);
567 }; 567 };
568 568
569 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_ 569 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_EDIT_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views.cc ('k') | components/omnibox/browser/omnibox_edit_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698