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

Side by Side Diff: components/omnibox/browser/omnibox_view.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // This file defines the interface class OmniboxView. Each toolkit will 5 // This file defines the interface class OmniboxView. Each toolkit will
6 // implement the edit view differently, so that code is inherently platform 6 // implement the edit view differently, so that code is inherently platform
7 // specific. However, the OmniboxEditModel needs to do some communication with 7 // specific. However, the OmniboxEditModel needs to do some communication with
8 // the view. Since the model is shared between platforms, we need to define an 8 // the view. Since the model is shared between platforms, we need to define an
9 // interface that all view implementations will share. 9 // interface that all view implementations will share.
10 10
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // Like GetIcon(), but returns a vector icon identifier. If |invert| is true, 81 // Like GetIcon(), but returns a vector icon identifier. If |invert| is true,
82 // this returns an icon suitable for display in an inverted (light-on-dark) 82 // this returns an icon suitable for display in an inverted (light-on-dark)
83 // color scheme. 83 // color scheme.
84 gfx::VectorIconId GetVectorIcon(bool invert) const; 84 gfx::VectorIconId GetVectorIcon(bool invert) const;
85 85
86 // The user text is the text the user has manually keyed in. When present, 86 // The user text is the text the user has manually keyed in. When present,
87 // this is shown in preference to the permanent text; hitting escape will 87 // this is shown in preference to the permanent text; hitting escape will
88 // revert to the permanent text. 88 // revert to the permanent text.
89 void SetUserText(const base::string16& text); 89 void SetUserText(const base::string16& text);
90 virtual void SetUserText(const base::string16& text, 90 virtual void SetUserText(const base::string16& text,
91 const base::string16& display_text,
92 bool update_popup); 91 bool update_popup);
93 92
94 // Sets the window text and the caret position. |notify_text_changed| is true 93 // Sets the window text and the caret position. |notify_text_changed| is true
95 // if the model should be notified of the change. 94 // if the model should be notified of the change.
96 virtual void SetWindowTextAndCaretPos(const base::string16& text, 95 virtual void SetWindowTextAndCaretPos(const base::string16& text,
97 size_t caret_pos, 96 size_t caret_pos,
98 bool update_popup, 97 bool update_popup,
99 bool notify_text_changed) = 0; 98 bool notify_text_changed) = 0;
100 99
101 // Sets the edit to forced query mode. Practically speaking, this means that 100 // Sets the edit to forced query mode. Practically speaking, this means that
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ShowURL); 263 FRIEND_TEST_ALL_PREFIXES(InstantExtendedTest, ShowURL);
265 264
266 // |model_| can be NULL in tests. 265 // |model_| can be NULL in tests.
267 std::unique_ptr<OmniboxEditModel> model_; 266 std::unique_ptr<OmniboxEditModel> model_;
268 OmniboxEditController* controller_; 267 OmniboxEditController* controller_;
269 268
270 DISALLOW_COPY_AND_ASSIGN(OmniboxView); 269 DISALLOW_COPY_AND_ASSIGN(OmniboxView);
271 }; 270 };
272 271
273 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ 272 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_
OLDNEW
« no previous file with comments | « components/omnibox/browser/omnibox_edit_unittest.cc ('k') | components/omnibox/browser/omnibox_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698