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 #include "components/toolbar/test_toolbar_model.h" | 5 #include "components/toolbar/test_toolbar_model.h" |
6 | 6 |
7 #include "ui/gfx/vector_icons_public.h" | 7 #include "ui/gfx/vector_icons_public.h" |
8 | 8 |
9 TestToolbarModel::TestToolbarModel() | 9 TestToolbarModel::TestToolbarModel() |
10 : security_level_(security_state::SecurityStateModel::NONE), | 10 : security_level_(security_state::NONE), |
11 #if defined(TOOLKIT_VIEWS) | 11 #if defined(TOOLKIT_VIEWS) |
12 icon_(gfx::VectorIconId::LOCATION_BAR_HTTP), | 12 icon_(gfx::VectorIconId::LOCATION_BAR_HTTP), |
13 #else | 13 #else |
14 icon_(gfx::VectorIconId::VECTOR_ICON_NONE), | 14 icon_(gfx::VectorIconId::VECTOR_ICON_NONE), |
15 #endif | 15 #endif |
16 should_display_url_(true) { | 16 should_display_url_(true) { |
17 } | 17 } |
18 | 18 |
19 TestToolbarModel::~TestToolbarModel() {} | 19 TestToolbarModel::~TestToolbarModel() {} |
20 | 20 |
21 base::string16 TestToolbarModel::GetFormattedURL(size_t* prefix_end) const { | 21 base::string16 TestToolbarModel::GetFormattedURL(size_t* prefix_end) const { |
22 return text_; | 22 return text_; |
23 } | 23 } |
24 | 24 |
25 GURL TestToolbarModel::GetURL() const { | 25 GURL TestToolbarModel::GetURL() const { |
26 return url_; | 26 return url_; |
27 } | 27 } |
28 | 28 |
29 security_state::SecurityStateModel::SecurityLevel | 29 security_state::SecurityLevel TestToolbarModel::GetSecurityLevel( |
30 TestToolbarModel::GetSecurityLevel(bool ignore_editing) const { | 30 bool ignore_editing) const { |
31 return security_level_; | 31 return security_level_; |
32 } | 32 } |
33 | 33 |
34 gfx::VectorIconId TestToolbarModel::GetVectorIcon() const { | 34 gfx::VectorIconId TestToolbarModel::GetVectorIcon() const { |
35 return icon_; | 35 return icon_; |
36 } | 36 } |
37 | 37 |
38 base::string16 TestToolbarModel::GetSecureVerboseText() const { | 38 base::string16 TestToolbarModel::GetSecureVerboseText() const { |
39 return base::string16(); | 39 return base::string16(); |
40 } | 40 } |
41 | 41 |
42 base::string16 TestToolbarModel::GetEVCertName() const { | 42 base::string16 TestToolbarModel::GetEVCertName() const { |
43 return (security_level_ == security_state::SecurityStateModel::EV_SECURE) | 43 return (security_level_ == security_state::EV_SECURE) ? ev_cert_name_ |
44 ? ev_cert_name_ | 44 : base::string16(); |
45 : base::string16(); | |
46 } | 45 } |
47 | 46 |
48 bool TestToolbarModel::ShouldDisplayURL() const { | 47 bool TestToolbarModel::ShouldDisplayURL() const { |
49 return should_display_url_; | 48 return should_display_url_; |
50 } | 49 } |
OLD | NEW |