| 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 #if defined(TOOLKIT_VIEWS) |
| 8 #include "components/toolbar/vector_icons.h" // nogncheck |
| 9 #endif |
| 8 | 10 |
| 9 TestToolbarModel::TestToolbarModel() | 11 TestToolbarModel::TestToolbarModel() |
| 10 : security_level_(security_state::NONE), | 12 : security_level_(security_state::NONE), |
| 11 #if defined(TOOLKIT_VIEWS) | 13 #if defined(TOOLKIT_VIEWS) |
| 12 icon_(gfx::VectorIconId::LOCATION_BAR_HTTP), | 14 icon_(&toolbar::kHttpIcon), |
| 13 #else | |
| 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::SecurityLevel TestToolbarModel::GetSecurityLevel( | 29 security_state::SecurityLevel TestToolbarModel::GetSecurityLevel( |
| 30 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 const gfx::VectorIcon& 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::EV_SECURE) ? ev_cert_name_ | 43 return (security_level_ == security_state::EV_SECURE) ? ev_cert_name_ |
| 44 : base::string16(); | 44 : base::string16(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 bool TestToolbarModel::ShouldDisplayURL() const { | 47 bool TestToolbarModel::ShouldDisplayURL() const { |
| 48 return should_display_url_; | 48 return should_display_url_; |
| 49 } | 49 } |
| OLD | NEW |