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_TEST_TOOLBAR_MODEL_H_ | 5 #ifndef COMPONENTS_TOOLBAR_TEST_TOOLBAR_MODEL_H_ |
6 #define COMPONENTS_TOOLBAR_TEST_TOOLBAR_MODEL_H_ | 6 #define COMPONENTS_TOOLBAR_TEST_TOOLBAR_MODEL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "components/toolbar/toolbar_model.h" | 13 #include "components/toolbar/toolbar_model.h" |
14 | 14 |
15 namespace gfx { | 15 namespace gfx { |
16 enum class VectorIconId; | 16 enum class VectorIconId; |
17 } | 17 } |
18 | 18 |
19 // A ToolbarModel that is backed by instance variables, which are initialized | 19 // A ToolbarModel that is backed by instance variables, which are initialized |
20 // with some basic values that can be changed with the provided setters. This | 20 // with some basic values that can be changed with the provided setters. This |
21 // should be used only for testing. | 21 // should be used only for testing. |
22 class TestToolbarModel : public ToolbarModel { | 22 class TestToolbarModel : public ToolbarModel { |
23 public: | 23 public: |
24 TestToolbarModel(); | 24 TestToolbarModel(); |
25 ~TestToolbarModel() override; | 25 ~TestToolbarModel() override; |
26 base::string16 GetFormattedURL(size_t* prefix_end) const override; | 26 base::string16 GetFormattedURL(size_t* prefix_end) const override; |
27 GURL GetURL() const override; | 27 GURL GetURL() const override; |
28 security_state::SecurityStateModel::SecurityLevel GetSecurityLevel( | 28 security_state::SecurityStateModel::SecurityLevel GetSecurityLevel( |
29 bool ignore_editing) const override; | 29 bool ignore_editing) const override; |
| 30 int GetIcon() const override; |
30 gfx::VectorIconId GetVectorIcon() const override; | 31 gfx::VectorIconId GetVectorIcon() const override; |
31 base::string16 GetSecureVerboseText() const override; | 32 base::string16 GetSecureVerboseText() const override; |
32 base::string16 GetEVCertName() const override; | 33 base::string16 GetEVCertName() const override; |
33 bool ShouldDisplayURL() const override; | 34 bool ShouldDisplayURL() const override; |
34 | 35 |
35 void set_text(const base::string16& text) { text_ = text; } | 36 void set_text(const base::string16& text) { text_ = text; } |
36 void set_url(const GURL& url) { url_ = url;} | 37 void set_url(const GURL& url) { url_ = url;} |
37 void set_security_level( | 38 void set_security_level( |
38 security_state::SecurityStateModel::SecurityLevel security_level) { | 39 security_state::SecurityStateModel::SecurityLevel security_level) { |
39 security_level_ = security_level; | 40 security_level_ = security_level; |
(...skipping 11 matching lines...) Expand all Loading... |
51 GURL url_; | 52 GURL url_; |
52 security_state::SecurityStateModel::SecurityLevel security_level_; | 53 security_state::SecurityStateModel::SecurityLevel security_level_; |
53 gfx::VectorIconId icon_; | 54 gfx::VectorIconId 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 // COMPONENTS_TOOLBAR_TEST_TOOLBAR_MODEL_H_ | 61 #endif // COMPONENTS_TOOLBAR_TEST_TOOLBAR_MODEL_H_ |
OLD | NEW |