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/theme_resources.h" | 7 #include "grit/theme_resources.h" |
8 | 8 |
9 TestToolbarModel::TestToolbarModel() | 9 TestToolbarModel::TestToolbarModel() |
10 : ToolbarModel(), | 10 : ToolbarModel(), |
11 perform_search_term_replacement_(false), | 11 perform_search_term_replacement_(false), |
12 security_level_(ConnectionSecurityHelper::NONE), | 12 security_level_(NONE), |
13 icon_(IDR_LOCATION_BAR_HTTP), | 13 icon_(IDR_LOCATION_BAR_HTTP), |
14 should_display_url_(true) { | 14 should_display_url_(true) {} |
15 } | |
16 | 15 |
17 TestToolbarModel::~TestToolbarModel() {} | 16 TestToolbarModel::~TestToolbarModel() {} |
18 | 17 |
19 base::string16 TestToolbarModel::GetText() const { | 18 base::string16 TestToolbarModel::GetText() const { |
20 return text_; | 19 return text_; |
21 } | 20 } |
22 | 21 |
23 base::string16 TestToolbarModel::GetFormattedURL(size_t* prefix_end) const { | 22 base::string16 TestToolbarModel::GetFormattedURL(size_t* prefix_end) const { |
24 return text_; | 23 return text_; |
25 } | 24 } |
26 | 25 |
27 base::string16 TestToolbarModel::GetCorpusNameForMobile() const { | 26 base::string16 TestToolbarModel::GetCorpusNameForMobile() const { |
28 return base::string16(); | 27 return base::string16(); |
29 } | 28 } |
30 | 29 |
31 GURL TestToolbarModel::GetURL() const { | 30 GURL TestToolbarModel::GetURL() const { |
32 return url_; | 31 return url_; |
33 } | 32 } |
34 | 33 |
35 bool TestToolbarModel::WouldPerformSearchTermReplacement( | 34 bool TestToolbarModel::WouldPerformSearchTermReplacement( |
36 bool ignore_editing) const { | 35 bool ignore_editing) const { |
37 return perform_search_term_replacement_; | 36 return perform_search_term_replacement_; |
38 } | 37 } |
39 | 38 |
40 ConnectionSecurityHelper::SecurityLevel TestToolbarModel::GetSecurityLevel( | 39 ToolbarModel::SecurityLevel TestToolbarModel::GetSecurityLevel( |
41 bool ignore_editing) const { | 40 bool ignore_editing) const { |
42 return security_level_; | 41 return security_level_; |
43 } | 42 } |
44 | 43 |
45 int TestToolbarModel::GetIcon() const { | 44 int TestToolbarModel::GetIcon() const { |
46 return icon_; | 45 return icon_; |
47 } | 46 } |
48 | 47 |
49 int TestToolbarModel::GetIconForSecurityLevel( | 48 int TestToolbarModel::GetIconForSecurityLevel(SecurityLevel level) const { |
50 ConnectionSecurityHelper::SecurityLevel level) const { | |
51 return icon_; | 49 return icon_; |
52 } | 50 } |
53 | 51 |
54 base::string16 TestToolbarModel::GetEVCertName() const { | 52 base::string16 TestToolbarModel::GetEVCertName() const { |
55 return (security_level_ == ConnectionSecurityHelper::EV_SECURE) | 53 return (security_level_ == EV_SECURE) ? ev_cert_name_ : base::string16(); |
56 ? ev_cert_name_ | |
57 : base::string16(); | |
58 } | 54 } |
59 | 55 |
60 bool TestToolbarModel::ShouldDisplayURL() const { | 56 bool TestToolbarModel::ShouldDisplayURL() const { |
61 return should_display_url_; | 57 return should_display_url_; |
62 } | 58 } |
OLD | NEW |