| 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/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "chrome/browser/ui/toolbar/chrome_toolbar_model.h" | 10 #include "chrome/browser/ui/toolbar/chrome_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 ChromeToolbarModel { | 15 class TestToolbarModel : public ChromeToolbarModel { |
| 16 public: | 16 public: |
| 17 TestToolbarModel(); | 17 TestToolbarModel(); |
| 18 ~TestToolbarModel() override; | 18 ~TestToolbarModel() override; |
| 19 base::string16 GetText() const override; | 19 base::string16 GetText() const override; |
| 20 base::string16 GetFormattedURL(size_t* prefix_end) const override; | 20 base::string16 GetFormattedURL(size_t* prefix_end) const override; |
| 21 base::string16 GetCorpusNameForMobile() const override; | 21 base::string16 GetCorpusNameForMobile() const override; |
| 22 GURL GetURL() const override; | 22 GURL GetURL() const override; |
| 23 bool WouldPerformSearchTermReplacement(bool ignore_editing) const override; | 23 bool WouldPerformSearchTermReplacement(bool ignore_editing) const override; |
| 24 SecurityStateModel::SecurityLevel GetSecurityLevel( | 24 security_state::SecurityStateModel::SecurityLevel GetSecurityLevel( |
| 25 bool ignore_editing) const override; | 25 bool ignore_editing) const override; |
| 26 int GetIcon() const override; | 26 int GetIcon() const override; |
| 27 gfx::VectorIconId GetVectorIcon() const override; | 27 gfx::VectorIconId GetVectorIcon() const override; |
| 28 base::string16 GetEVCertName() const override; | 28 base::string16 GetEVCertName() const override; |
| 29 bool ShouldDisplayURL() const override; | 29 bool ShouldDisplayURL() const override; |
| 30 | 30 |
| 31 void set_text(const base::string16& text) { text_ = text; } | 31 void set_text(const base::string16& text) { text_ = text; } |
| 32 void set_url(const GURL& url) { url_ = url;} | 32 void set_url(const GURL& url) { url_ = url;} |
| 33 void set_perform_search_term_replacement( | 33 void set_perform_search_term_replacement( |
| 34 bool perform_search_term_replacement) { | 34 bool perform_search_term_replacement) { |
| 35 perform_search_term_replacement_ = perform_search_term_replacement; | 35 perform_search_term_replacement_ = perform_search_term_replacement; |
| 36 } | 36 } |
| 37 void set_security_level(SecurityStateModel::SecurityLevel security_level) { | 37 void set_security_level( |
| 38 security_state::SecurityStateModel::SecurityLevel security_level) { |
| 38 security_level_ = security_level; | 39 security_level_ = security_level; |
| 39 } | 40 } |
| 40 void set_icon(int icon) { icon_ = icon; } | 41 void set_icon(int icon) { icon_ = icon; } |
| 41 void set_ev_cert_name(const base::string16& ev_cert_name) { | 42 void set_ev_cert_name(const base::string16& ev_cert_name) { |
| 42 ev_cert_name_ = ev_cert_name; | 43 ev_cert_name_ = ev_cert_name; |
| 43 } | 44 } |
| 44 void set_should_display_url(bool should_display_url) { | 45 void set_should_display_url(bool should_display_url) { |
| 45 should_display_url_ = should_display_url; | 46 should_display_url_ = should_display_url; |
| 46 } | 47 } |
| 47 | 48 |
| 48 private: | 49 private: |
| 49 base::string16 text_; | 50 base::string16 text_; |
| 50 GURL url_; | 51 GURL url_; |
| 51 bool perform_search_term_replacement_; | 52 bool perform_search_term_replacement_; |
| 52 SecurityStateModel::SecurityLevel security_level_; | 53 security_state::SecurityStateModel::SecurityLevel security_level_; |
| 53 int icon_; | 54 int icon_; |
| 54 base::string16 ev_cert_name_; | 55 base::string16 ev_cert_name_; |
| 55 bool should_display_url_; | 56 bool should_display_url_; |
| 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 |