• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/theme_resources.h"
8 
TestToolbarModel()9 TestToolbarModel::TestToolbarModel()
10     : ToolbarModel(),
11       omit_url_due_to_origin_chip_(false),
12       perform_search_term_replacement_(false),
13       security_level_(NONE),
14       icon_(IDR_LOCATION_BAR_HTTP),
15       should_display_url_(true) {}
16 
~TestToolbarModel()17 TestToolbarModel::~TestToolbarModel() {}
18 
GetText() const19 base::string16 TestToolbarModel::GetText() const {
20   return text_;
21 }
22 
GetFormattedURL(size_t * prefix_end) const23 base::string16 TestToolbarModel::GetFormattedURL(size_t* prefix_end) const {
24   return text_;
25 }
26 
GetCorpusNameForMobile() const27 base::string16 TestToolbarModel::GetCorpusNameForMobile() const {
28   return base::string16();
29 }
30 
GetURL() const31 GURL TestToolbarModel::GetURL() const {
32   return url_;
33 }
34 
WouldOmitURLDueToOriginChip() const35 bool TestToolbarModel::WouldOmitURLDueToOriginChip() const {
36   return omit_url_due_to_origin_chip_;
37 }
38 
WouldPerformSearchTermReplacement(bool ignore_editing) const39 bool TestToolbarModel::WouldPerformSearchTermReplacement(
40     bool ignore_editing) const {
41   return perform_search_term_replacement_;
42 }
43 
GetSecurityLevel(bool ignore_editing) const44 ToolbarModel::SecurityLevel TestToolbarModel::GetSecurityLevel(
45     bool ignore_editing) const {
46   return security_level_;
47 }
48 
GetIcon() const49 int TestToolbarModel::GetIcon() const {
50   return icon_;
51 }
52 
GetIconForSecurityLevel(SecurityLevel level) const53 int TestToolbarModel::GetIconForSecurityLevel(SecurityLevel level) const {
54   return icon_;
55 }
56 
GetEVCertName() const57 base::string16 TestToolbarModel::GetEVCertName() const {
58   return (security_level_ == EV_SECURE) ? ev_cert_name_ : base::string16();
59 }
60 
ShouldDisplayURL() const61 bool TestToolbarModel::ShouldDisplayURL() const {
62   return should_display_url_;
63 }
64