Chromium Code Reviews| 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_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_IMPL_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_IMPL_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 virtual ~ToolbarModelImpl(); | 34 virtual ~ToolbarModelImpl(); |
| 35 | 35 |
| 36 static SecurityLevel GetSecurityLevelForWebContents( | 36 static SecurityLevel GetSecurityLevelForWebContents( |
| 37 content::WebContents* web_contents); | 37 content::WebContents* web_contents); |
| 38 | 38 |
| 39 // Overriden from ToolbarModel. | 39 // Overriden from ToolbarModel. |
| 40 virtual string16 GetText( | 40 virtual string16 GetText( |
| 41 bool display_search_urls_as_search_terms) const OVERRIDE; | 41 bool display_search_urls_as_search_terms) const OVERRIDE; |
| 42 virtual string16 GetCorpusNameForMobile() const OVERRIDE; | 42 virtual string16 GetCorpusNameForMobile() const OVERRIDE; |
| 43 virtual GURL GetURL() const OVERRIDE; | 43 virtual GURL GetURL() const OVERRIDE; |
| 44 virtual bool WouldReplaceSearchURLWithSearchTerms() const OVERRIDE; | 44 virtual SearchTermType GetSearchTermType() const OVERRIDE; |
| 45 virtual void SetIsProminentSearchTermUISupported(bool value) OVERRIDE; | |
| 45 virtual SecurityLevel GetSecurityLevel() const OVERRIDE; | 46 virtual SecurityLevel GetSecurityLevel() const OVERRIDE; |
| 46 virtual int GetIcon() const OVERRIDE; | 47 virtual int GetIcon() const OVERRIDE; |
| 47 virtual string16 GetEVCertName() const OVERRIDE; | 48 virtual string16 GetEVCertName() const OVERRIDE; |
| 48 virtual bool ShouldDisplayURL() const OVERRIDE; | 49 virtual bool ShouldDisplayURL() const OVERRIDE; |
| 49 virtual void SetInputInProgress(bool value) OVERRIDE; | 50 virtual void SetInputInProgress(bool value) OVERRIDE; |
| 50 virtual bool GetInputInProgress() const OVERRIDE; | 51 virtual bool GetInputInProgress() const OVERRIDE; |
| 51 | 52 |
| 52 // Returns "<organization_name> [<country>]". | 53 // Returns "<organization_name> [<country>]". |
| 53 static string16 GetEVCertName(const net::X509Certificate& cert); | 54 static string16 GetEVCertName(const net::X509Certificate& cert); |
| 54 | 55 |
| 55 private: | 56 private: |
| 56 // Returns the navigation controller used to retrieve the navigation entry | 57 // Returns the navigation controller used to retrieve the navigation entry |
| 57 // from which the states are retrieved. | 58 // from which the states are retrieved. |
| 58 // If this returns NULL, default values are used. | 59 // If this returns NULL, default values are used. |
| 59 content::NavigationController* GetNavigationController() const; | 60 content::NavigationController* GetNavigationController() const; |
| 60 | 61 |
| 61 // Helper method to extract the profile from the navigation controller. | 62 // Helper method to extract the profile from the navigation controller. |
| 62 Profile* GetProfile() const; | 63 Profile* GetProfile() const; |
| 63 | 64 |
| 64 // Returns search terms as in chrome::GetSearchTerms unless those | 65 // Gets search terms as in chrome::GetSearchTerms. The only exception is |
| 65 // terms would be treated by the omnibox as a navigation. | 66 // if the search terms would be treated by the omnibox as navigation and |
| 66 string16 GetSearchTerms() const; | 67 // prominent search term UI is not supported. Also returns the search term |
|
sreeram
2013/04/25 16:37:10
"... not supported, in which case this returns an
sail
2013/04/25 16:41:22
Done.
| |
| 68 // type. | |
| 69 SearchTermType GetSearchTerms(string16* search_terms_out) const; | |
| 67 | 70 |
| 68 ToolbarModelDelegate* delegate_; | 71 ToolbarModelDelegate* delegate_; |
| 69 | 72 |
| 70 // Whether the text in the location bar is currently being edited. | 73 // Whether the text in the location bar is currently being edited. |
| 71 bool input_in_progress_; | 74 bool input_in_progress_; |
| 72 | 75 |
| 76 // True if the UI can display a more prominent UI for search terms that | |
| 77 // require it. | |
| 78 bool is_prominent_search_term_ui_supported_; | |
| 79 | |
| 73 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarModelImpl); | 80 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarModelImpl); |
| 74 }; | 81 }; |
| 75 | 82 |
| 76 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_IMPL_H_ | 83 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_IMPL_H_ |
| OLD | NEW |