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

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

Issue 2891653003: [omnibox] Break out SetCaretPos() method and enhance browser test (Closed)
Patch Set: Fixed range on Cocoa Created 3 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 virtual void SetUserText(const base::string16& text, 97 virtual void SetUserText(const base::string16& text,
98 bool update_popup); 98 bool update_popup);
99 99
100 // Sets the window text and the caret position. |notify_text_changed| is true 100 // Sets the window text and the caret position. |notify_text_changed| is true
101 // if the model should be notified of the change. 101 // if the model should be notified of the change.
102 virtual void SetWindowTextAndCaretPos(const base::string16& text, 102 virtual void SetWindowTextAndCaretPos(const base::string16& text,
103 size_t caret_pos, 103 size_t caret_pos,
104 bool update_popup, 104 bool update_popup,
105 bool notify_text_changed) = 0; 105 bool notify_text_changed) = 0;
106 106
107 // Sets the caret position. Removes any selection. Clamps the requested caret
108 // position to the length of the current text.
109 virtual void SetCaretPos(size_t caret_pos) = 0;
110
107 // Transitions the user into keyword mode with their default search provider, 111 // Transitions the user into keyword mode with their default search provider,
108 // preserving and selecting the user's text if they already typed in a query. 112 // preserving and selecting the user's text if they already typed in a query.
109 virtual void EnterKeywordModeForDefaultSearchProvider() = 0; 113 virtual void EnterKeywordModeForDefaultSearchProvider() = 0;
110 114
111 // Returns true if all text is selected or there is no text at all. 115 // Returns true if all text is selected or there is no text at all.
112 virtual bool IsSelectAll() const = 0; 116 virtual bool IsSelectAll() const = 0;
113 117
114 // Returns true if the user deleted the suggested text. 118 // Returns true if the user deleted the suggested text.
115 virtual bool DeleteAtEndPressed() = 0; 119 virtual bool DeleteAtEndPressed() = 0;
116 120
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 friend class OmniboxViewMacTest; 286 friend class OmniboxViewMacTest;
283 287
284 // |model_| can be NULL in tests. 288 // |model_| can be NULL in tests.
285 std::unique_ptr<OmniboxEditModel> model_; 289 std::unique_ptr<OmniboxEditModel> model_;
286 OmniboxEditController* controller_; 290 OmniboxEditController* controller_;
287 291
288 DISALLOW_COPY_AND_ASSIGN(OmniboxView); 292 DISALLOW_COPY_AND_ASSIGN(OmniboxView);
289 }; 293 };
290 294
291 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ 295 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_
OLDNEW
« no previous file with comments | « components/omnibox/browser/omnibox_edit_unittest.cc ('k') | ios/chrome/browser/ui/omnibox/omnibox_view_ios.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698