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.
5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_
8 #include "base/compiler_specific.h"
9 #include "base/strings/string16.h"
10 #include "chrome/browser/ui/toolbar/toolbar_model.h"
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 TestToolbarModel : public ToolbarModel {
18 virtual ~TestToolbarModel();
19 virtual string16 GetText(bool allow_search_term_replacement) const OVERRIDE;
20 virtual string16 GetCorpusNameForMobile() const OVERRIDE;
21 virtual GURL GetURL() const OVERRIDE;
22 virtual bool WouldPerformSearchTermReplacement(
23 bool ignore_editing) const OVERRIDE;
24 virtual SecurityLevel GetSecurityLevel(bool ignore_editing) const OVERRIDE;
25 virtual int GetIcon() const OVERRIDE;
26 virtual string16 GetEVCertName() const OVERRIDE;
27 virtual bool ShouldDisplayURL() const OVERRIDE;
29 void set_text(const string16& text) { text_ = text; }
30 void set_url(const GURL& url) { url_ = url;}
31 void set_replace_search_url_with_search_terms(bool should_replace_url) {
32 should_replace_url_ = should_replace_url;
34 void set_security_level(SecurityLevel security_level) {
35 security_level_ = security_level;
37 void set_icon(int icon) { icon_ = icon; }
38 void set_ev_cert_name(const string16& ev_cert_name) {
39 ev_cert_name_ = ev_cert_name;
41 void set_should_display_url(bool should_display_url) {
42 should_display_url_ = should_display_url;
48 bool should_replace_url_;
49 SecurityLevel security_level_;
51 string16 ev_cert_name_;
52 bool should_display_url_;
54 DISALLOW_COPY_AND_ASSIGN(TestToolbarModel);
57 #endif // CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_