 Chromium Code Reviews
 Chromium Code Reviews Issue 11040055:
  Adds a FakeToolbarModel for use in testing.  (Closed) 
  Base URL: http://git.chromium.org/chromium/src.git@master
    
  
    Issue 11040055:
  Adds a FakeToolbarModel for use in testing.  (Closed) 
  Base URL: http://git.chromium.org/chromium/src.git@master| 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/fake_toolbar_model.h" | |
| 6 | |
| 7 #include "base/utf_string_conversions.h" | |
| 8 | |
| 9 FakeToolbarModel::FakeToolbarModel() : ToolbarModel(NULL), | |
| 
sky
2012/10/05 16:41:22
ToolbarModel(NULL) should be on the next line.
 
lliabraa
2012/10/09 19:29:35
Done.
 | |
| 10 text_(ASCIIToUTF16("www.chromium.org")), | |
| 
sky
2012/10/05 16:41:22
I think you should leave all the strings/urls empt
 
lliabraa
2012/10/09 19:29:35
Done.
 | |
| 11 url_("http://www.chromium.org"), | |
| 12 should_replace_url_(false), | |
| 13 security_level_(NONE), | |
| 14 icon_(0), | |
| 15 ev_cert_name_(ASCIIToUTF16("ev cert name")), | |
| 16 should_display_url_(true) {} | |
| 17 | |
| 18 FakeToolbarModel::~FakeToolbarModel() {} | |
| 19 | |
| 20 void FakeToolbarModel::SetText(string16 text) { | |
| 21 text_ = text; | |
| 22 } | |
| 23 | |
| 24 string16 FakeToolbarModel::GetText( | |
| 25 bool display_search_urls_as_search_terms) const { | |
| 26 return text_; | |
| 27 } | |
| 28 | |
| 29 void FakeToolbarModel::SetURL(GURL url) { | |
| 30 url_ = url; | |
| 31 } | |
| 32 | |
| 33 GURL FakeToolbarModel::GetURL() const { | |
| 34 return url_; | |
| 35 } | |
| 36 | |
| 37 void FakeToolbarModel::SetReplaceSearchURLWithSearchTerms( | |
| 38 bool should_replace_url) { | |
| 39 should_replace_url_ = should_replace_url; | |
| 40 } | |
| 41 | |
| 42 bool FakeToolbarModel::WouldReplaceSearchURLWithSearchTerms() const { | |
| 43 return should_replace_url_; | |
| 44 } | |
| 45 | |
| 46 void FakeToolbarModel::SetSecurityLevel(SecurityLevel security_level) { | |
| 47 security_level_ = security_level; | |
| 48 } | |
| 49 | |
| 50 ToolbarModel::SecurityLevel FakeToolbarModel::GetSecurityLevel() const { | |
| 51 return security_level_; | |
| 52 } | |
| 53 | |
| 54 void FakeToolbarModel::SetIcon(int icon) { | |
| 55 icon_ = icon; | |
| 56 } | |
| 57 | |
| 58 int FakeToolbarModel::GetIcon() const { | |
| 59 return icon_; | |
| 60 } | |
| 61 | |
| 62 void FakeToolbarModel::SetEVCertName(string16 ev_cert_name) { | |
| 63 ev_cert_name_ = ev_cert_name; | |
| 64 } | |
| 65 | |
| 66 string16 FakeToolbarModel::GetEVCertName() const { | |
| 67 return ev_cert_name_; | |
| 68 } | |
| 69 | |
| 70 void FakeToolbarModel::SetShouldDisplayURL(bool should_display_url) { | |
| 71 should_display_url_ = should_display_url; | |
| 72 } | |
| 73 | |
| 74 bool FakeToolbarModel::ShouldDisplayURL() const { | |
| 75 return should_display_url_; | |
| 76 } | |
| OLD | NEW |