| 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_TEST_TOOLBAR_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 10 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 11 | 11 |
| 12 // A ToolbarModel that is backed by instance variables, which are initialized | 12 // A ToolbarModel that is backed by instance variables, which are initialized |
| 13 // with some basic values that can be changed with the provided setters. This | 13 // with some basic values that can be changed with the provided setters. This |
| 14 // should be used only for testing. | 14 // should be used only for testing. |
| 15 class TestToolbarModel : public ToolbarModel { | 15 class TestToolbarModel : public ToolbarModel { |
| 16 public: | 16 public: |
| 17 TestToolbarModel(); | 17 TestToolbarModel(); |
| 18 virtual ~TestToolbarModel(); | 18 virtual ~TestToolbarModel(); |
| 19 virtual string16 GetText( | 19 virtual string16 GetText( |
| 20 bool display_search_urls_as_search_terms) const OVERRIDE; | 20 bool display_search_urls_as_search_terms) const OVERRIDE; |
| 21 virtual string16 GetCorpusNameForMobile() const OVERRIDE; | 21 virtual string16 GetCorpusNameForMobile() const OVERRIDE; |
| 22 virtual GURL GetURL() const OVERRIDE; | 22 virtual GURL GetURL() const OVERRIDE; |
| 23 virtual bool WouldReplaceSearchURLWithSearchTerms() const OVERRIDE; | 23 virtual SearchTermType GetSearchTermType() const OVERRIDE; |
| 24 virtual void SetIsProminentSearchTermUISupported(bool value) OVERRIDE; |
| 24 virtual SecurityLevel GetSecurityLevel() const OVERRIDE; | 25 virtual SecurityLevel GetSecurityLevel() const OVERRIDE; |
| 25 virtual int GetIcon() const OVERRIDE; | 26 virtual int GetIcon() const OVERRIDE; |
| 26 virtual string16 GetEVCertName() const OVERRIDE; | 27 virtual string16 GetEVCertName() const OVERRIDE; |
| 27 virtual bool ShouldDisplayURL() const OVERRIDE; | 28 virtual bool ShouldDisplayURL() const OVERRIDE; |
| 28 virtual void SetInputInProgress(bool value) OVERRIDE; | 29 virtual void SetInputInProgress(bool value) OVERRIDE; |
| 29 virtual bool GetInputInProgress() const OVERRIDE; | 30 virtual bool GetInputInProgress() const OVERRIDE; |
| 30 | 31 |
| 31 void set_text(const string16& text) { text_ = text; } | 32 void set_text(const string16& text) { text_ = text; } |
| 32 void set_url(const GURL& url) { url_ = url;} | 33 void set_url(const GURL& url) { url_ = url;} |
| 33 void set_replace_search_url_with_search_terms(bool should_replace_url) { | 34 void set_search_term_type(SearchTermType type) { |
| 34 should_replace_url_ = should_replace_url; | 35 search_term_type_ = type; |
| 35 } | 36 } |
| 36 void set_security_level(SecurityLevel security_level) { | 37 void set_security_level(SecurityLevel security_level) { |
| 37 security_level_ = security_level; | 38 security_level_ = security_level; |
| 38 } | 39 } |
| 39 void set_icon(int icon) { icon_ = icon; } | 40 void set_icon(int icon) { icon_ = icon; } |
| 40 void set_ev_cert_name(const string16& ev_cert_name) { | 41 void set_ev_cert_name(const string16& ev_cert_name) { |
| 41 ev_cert_name_ = ev_cert_name; | 42 ev_cert_name_ = ev_cert_name; |
| 42 } | 43 } |
| 43 void set_should_display_url(bool should_display_url) { | 44 void set_should_display_url(bool should_display_url) { |
| 44 should_display_url_ = should_display_url; | 45 should_display_url_ = should_display_url; |
| 45 } | 46 } |
| 46 | 47 |
| 47 private: | 48 private: |
| 48 string16 text_; | 49 string16 text_; |
| 49 GURL url_; | 50 GURL url_; |
| 50 bool should_replace_url_; | 51 SearchTermType search_term_type_; |
| 51 SecurityLevel security_level_; | 52 SecurityLevel security_level_; |
| 52 int icon_; | 53 int icon_; |
| 53 string16 ev_cert_name_; | 54 string16 ev_cert_name_; |
| 54 bool should_display_url_; | 55 bool should_display_url_; |
| 55 bool input_in_progress_; | 56 bool input_in_progress_; |
| 56 | 57 |
| 57 DISALLOW_COPY_AND_ASSIGN(TestToolbarModel); | 58 DISALLOW_COPY_AND_ASSIGN(TestToolbarModel); |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 #endif // CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_ | 61 #endif // CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_ |
| OLD | NEW |