OLD | NEW |
---|---|
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 // |GetTextLength| can't be used as the Windows override of this class | 252 // |GetTextLength| can't be used as the Windows override of this class |
253 // inherits from a class that defines a method with that name. | 253 // inherits from a class that defines a method with that name. |
254 virtual int GetOmniboxTextLength() const = 0; | 254 virtual int GetOmniboxTextLength() const = 0; |
255 | 255 |
256 // Try to parse the current text as a URL and colorize the components. | 256 // Try to parse the current text as a URL and colorize the components. |
257 virtual void EmphasizeURLComponents() = 0; | 257 virtual void EmphasizeURLComponents() = 0; |
258 | 258 |
259 OmniboxEditController* controller() { return controller_; } | 259 OmniboxEditController* controller() { return controller_; } |
260 const OmniboxEditController* controller() const { return controller_; } | 260 const OmniboxEditController* controller() const { return controller_; } |
261 | 261 |
262 // Deemphasize parts of the URL to draw attention to whatever best represents | |
263 // the "identity" of the URL. | |
264 enum DEEMPHASIZE_COMPONENTS { | |
Peter Kasting
2017/02/24 01:53:40
This should be CamelCase.
| |
265 EVERYTHING, | |
266 ALL_BUT_SCHEME, | |
267 ALL_BUT_HOST, | |
268 NOTHING, | |
269 }; | |
270 DEEMPHASIZE_COMPONENTS GetDeemphasis(const base::string16& url_scheme, | |
271 const bool has_host) const; | |
272 | |
262 private: | 273 private: |
263 friend class OmniboxViewMacTest; | 274 friend class OmniboxViewMacTest; |
264 | 275 |
265 // |model_| can be NULL in tests. | 276 // |model_| can be NULL in tests. |
266 std::unique_ptr<OmniboxEditModel> model_; | 277 std::unique_ptr<OmniboxEditModel> model_; |
267 OmniboxEditController* controller_; | 278 OmniboxEditController* controller_; |
268 | 279 |
269 DISALLOW_COPY_AND_ASSIGN(OmniboxView); | 280 DISALLOW_COPY_AND_ASSIGN(OmniboxView); |
270 }; | 281 }; |
271 | 282 |
272 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ | 283 #endif // COMPONENTS_OMNIBOX_BROWSER_OMNIBOX_VIEW_H_ |
OLD | NEW |