| 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 COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ | 5 #ifndef COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ |
| 6 #define COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ | 6 #define COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 virtual base::string16 GetText() const = 0; | 38 virtual base::string16 GetText() const = 0; |
| 39 | 39 |
| 40 // Returns a formatted URL for display in the toolbar. The formatting | 40 // Returns a formatted URL for display in the toolbar. The formatting |
| 41 // includes: | 41 // includes: |
| 42 // - Some characters may be unescaped. | 42 // - Some characters may be unescaped. |
| 43 // - The scheme and/or trailing slash may be dropped. | 43 // - The scheme and/or trailing slash may be dropped. |
| 44 // If |prefix_end| is non-NULL, it is set to the length of the pre-hostname | 44 // If |prefix_end| is non-NULL, it is set to the length of the pre-hostname |
| 45 // portion of the resulting URL. | 45 // portion of the resulting URL. |
| 46 virtual base::string16 GetFormattedURL(size_t* prefix_end) const = 0; | 46 virtual base::string16 GetFormattedURL(size_t* prefix_end) const = 0; |
| 47 | 47 |
| 48 // Some search URLs bundle a special "corpus" param that we can extract and | |
| 49 // display next to users' search terms in cases where we'd show the search | |
| 50 // terms instead of the URL anyway. For example, a Google image search might | |
| 51 // show the corpus "Images:" plus a search string. This is only used on | |
| 52 // mobile. | |
| 53 virtual base::string16 GetCorpusNameForMobile() const = 0; | |
| 54 | |
| 55 // Returns the URL of the current navigation entry. | 48 // Returns the URL of the current navigation entry. |
| 56 virtual GURL GetURL() const = 0; | 49 virtual GURL GetURL() const = 0; |
| 57 | 50 |
| 58 // Returns true if a call to GetText() would successfully replace the URL | 51 // Returns true if a call to GetText() would successfully replace the URL |
| 59 // with search terms. If |ignore_editing| is true, the result reflects the | 52 // with search terms. If |ignore_editing| is true, the result reflects the |
| 60 // underlying state of the page without regard to any user edits that may be | 53 // underlying state of the page without regard to any user edits that may be |
| 61 // in progress in the omnibox. | 54 // in progress in the omnibox. |
| 62 virtual bool WouldPerformSearchTermReplacement(bool ignore_editing) const = 0; | 55 virtual bool WouldPerformSearchTermReplacement(bool ignore_editing) const = 0; |
| 63 | 56 |
| 64 // Returns the security level that the toolbar should display. If | 57 // Returns the security level that the toolbar should display. If |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 ToolbarModel(); | 100 ToolbarModel(); |
| 108 | 101 |
| 109 private: | 102 private: |
| 110 bool input_in_progress_; | 103 bool input_in_progress_; |
| 111 bool url_replacement_enabled_; | 104 bool url_replacement_enabled_; |
| 112 | 105 |
| 113 DISALLOW_COPY_AND_ASSIGN(ToolbarModel); | 106 DISALLOW_COPY_AND_ASSIGN(ToolbarModel); |
| 114 }; | 107 }; |
| 115 | 108 |
| 116 #endif // COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ | 109 #endif // COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ |
| OLD | NEW |