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