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