 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 #ifndef CHROME_BROWSER_UI_TOOLBAR_FAKE_TOOLBAR_MODEL_H_ | |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_FAKE_TOOLBAR_MODEL_H_ | |
| 7 | |
| 8 #include "base/compiler_specific.h" | |
| 9 #include "base/string16.h" | |
| 10 #include "chrome/browser/ui/toolbar/toolbar_model.h" | |
| 11 | |
| 12 // A ToolbarModel that is backed by instance variables, which are initialized | |
| 13 // with some basic values that can be changed with the provided setters. This | |
| 14 // should be used only for testing. | |
| 15 class FakeToolbarModel : public ToolbarModel { | |
| 
sky
2012/10/09 20:07:13
Name this TestToolbarModel.
 
lliabraa
2012/10/10 19:39:34
Done.
 | |
| 16 public: | |
| 17 FakeToolbarModel(); | |
| 18 virtual ~FakeToolbarModel() OVERRIDE; | |
| 
sky
2012/10/09 20:07:13
no OVERRIDE here
 
lliabraa
2012/10/10 19:39:34
Done.
 | |
| 19 virtual string16 GetText( | |
| 20 bool display_search_urls_as_search_terms) const OVERRIDE; | |
| 21 virtual GURL GetURL() const OVERRIDE; | |
| 22 virtual bool WouldReplaceSearchURLWithSearchTerms() const OVERRIDE; | |
| 23 virtual SecurityLevel GetSecurityLevel() const OVERRIDE; | |
| 24 virtual int GetIcon() const OVERRIDE; | |
| 25 virtual string16 GetEVCertName() const OVERRIDE; | |
| 26 virtual bool ShouldDisplayURL() const OVERRIDE; | |
| 27 virtual void set_input_in_progress(bool value) OVERRIDE; | |
| 28 virtual bool input_in_progress() const OVERRIDE; | |
| 29 | |
| 30 void SetText(const string16& text) { text_ = text; } | |
| 
sky
2012/10/09 20:07:13
If you're going to inline all these (which is fine
 
lliabraa
2012/10/10 19:39:34
Done.
 | |
| 31 void SetURL(const GURL& url) { url_ = url;} | |
| 32 void SetReplaceSearchURLWithSearchTerms(bool should_replace_url) { | |
| 33 should_replace_url_ = should_replace_url; } | |
| 
sky
2012/10/09 20:07:13
When you wrap like this, wrap } to the next line.
 
lliabraa
2012/10/10 19:39:34
Done.
 | |
| 34 void SetSecurityLevel(SecurityLevel security_level) { | |
| 35 security_level_ = security_level; } | |
| 36 void SetIcon(int icon) { icon_ = icon; } | |
| 37 void SetEVCertName(const string16& ev_cert_name) { | |
| 38 ev_cert_name_ = ev_cert_name; } | |
| 39 void SetShouldDisplayURL(bool should_display_url) { | |
| 40 should_display_url_ = should_display_url; } | |
| 41 | |
| 42 private: | |
| 43 string16 text_; | |
| 44 GURL url_; | |
| 45 bool should_replace_url_; | |
| 46 SecurityLevel security_level_; | |
| 47 int icon_; | |
| 48 string16 ev_cert_name_; | |
| 49 bool should_display_url_; | |
| 50 bool input_in_progress_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(FakeToolbarModel); | |
| 53 }; | |
| 54 | |
| 55 #endif // CHROME_BROWSER_UI_TOOLBAR_FAKE_TOOLBAR_MODEL_H_ | |
| OLD | NEW |