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 CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ |
6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // will be displayed in place of the URL. | 44 // will be displayed in place of the URL. |
45 virtual string16 GetText(bool display_search_urls_as_search_terms) const = 0; | 45 virtual string16 GetText(bool display_search_urls_as_search_terms) const = 0; |
46 | 46 |
47 // Returns the URL of the current navigation entry. | 47 // Returns the URL of the current navigation entry. |
48 virtual GURL GetURL() const = 0; | 48 virtual GURL GetURL() const = 0; |
49 | 49 |
50 // Returns true if a call to GetText(true) would successfully replace the URL | 50 // Returns true if a call to GetText(true) would successfully replace the URL |
51 // with search terms. | 51 // with search terms. |
52 virtual bool WouldReplaceSearchURLWithSearchTerms() const = 0; | 52 virtual bool WouldReplaceSearchURLWithSearchTerms() const = 0; |
53 | 53 |
| 54 // Returns search terms if they were set on the NavigationEntry, or empty |
| 55 // string otherwise. |
| 56 virtual string16 GetSearchTermsFromNavigationEntry() const = 0; |
| 57 |
54 // Returns the security level that the toolbar should display. | 58 // Returns the security level that the toolbar should display. |
55 virtual SecurityLevel GetSecurityLevel() const = 0; | 59 virtual SecurityLevel GetSecurityLevel() const = 0; |
56 | 60 |
57 // Returns the resource_id of the icon to show to the left of the address, | 61 // Returns the resource_id of the icon to show to the left of the address, |
58 // based on the current URL. This doesn't cover specialized icons while the | 62 // based on the current URL. This doesn't cover specialized icons while the |
59 // user is editing; see OmniboxView::GetIcon(). | 63 // user is editing; see OmniboxView::GetIcon(). |
60 virtual int GetIcon() const = 0; | 64 virtual int GetIcon() const = 0; |
61 | 65 |
62 // Returns the name of the EV cert holder. Only call this when the security | 66 // Returns the name of the EV cert holder. Only call this when the security |
63 // level is EV_SECURE. | 67 // level is EV_SECURE. |
64 virtual string16 GetEVCertName() const = 0; | 68 virtual string16 GetEVCertName() const = 0; |
65 | 69 |
66 // Returns whether the URL for the current navigation entry should be | 70 // Returns whether the URL for the current navigation entry should be |
67 // in the location bar. | 71 // in the location bar. |
68 virtual bool ShouldDisplayURL() const = 0; | 72 virtual bool ShouldDisplayURL() const = 0; |
69 | 73 |
70 // Getter/setter of whether the text in location bar is currently being | 74 // Getter/setter of whether the text in location bar is currently being |
71 // edited. | 75 // edited. |
72 virtual void SetInputInProgress(bool value) = 0; | 76 virtual void SetInputInProgress(bool value) = 0; |
73 virtual bool GetInputInProgress() const = 0; | 77 virtual bool GetInputInProgress() const = 0; |
74 | 78 |
75 protected: | 79 protected: |
76 ToolbarModel() {} | 80 ToolbarModel() {} |
77 }; | 81 }; |
78 | 82 |
79 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ | 83 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ |
OLD | NEW |