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