Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: chrome/browser/ui/toolbar/test_toolbar_model.h

Issue 1135373003: Revert of Move SecurityLevel into a class of its own (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_ 6 #define CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_
7 7
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "chrome/browser/ui/toolbar/toolbar_model.h" 10 #include "chrome/browser/ui/toolbar/toolbar_model.h"
11 11
12 // A ToolbarModel that is backed by instance variables, which are initialized 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 13 // with some basic values that can be changed with the provided setters. This
14 // should be used only for testing. 14 // should be used only for testing.
15 class TestToolbarModel : public ToolbarModel { 15 class TestToolbarModel : public ToolbarModel {
16 public: 16 public:
17 TestToolbarModel(); 17 TestToolbarModel();
18 ~TestToolbarModel() override; 18 ~TestToolbarModel() override;
19 base::string16 GetText() const override; 19 base::string16 GetText() const override;
20 base::string16 GetFormattedURL(size_t* prefix_end) const override; 20 base::string16 GetFormattedURL(size_t* prefix_end) const override;
21 base::string16 GetCorpusNameForMobile() const override; 21 base::string16 GetCorpusNameForMobile() const override;
22 GURL GetURL() const override; 22 GURL GetURL() const override;
23 bool WouldPerformSearchTermReplacement(bool ignore_editing) const override; 23 bool WouldPerformSearchTermReplacement(bool ignore_editing) const override;
24 ConnectionSecurityHelper::SecurityLevel GetSecurityLevel( 24 SecurityLevel GetSecurityLevel(bool ignore_editing) const override;
25 bool ignore_editing) const override;
26 int GetIcon() const override; 25 int GetIcon() const override;
27 int GetIconForSecurityLevel( 26 int GetIconForSecurityLevel(SecurityLevel level) const override;
28 ConnectionSecurityHelper::SecurityLevel level) const override;
29 base::string16 GetEVCertName() const override; 27 base::string16 GetEVCertName() const override;
30 bool ShouldDisplayURL() const override; 28 bool ShouldDisplayURL() const override;
31 29
32 void set_text(const base::string16& text) { text_ = text; } 30 void set_text(const base::string16& text) { text_ = text; }
33 void set_url(const GURL& url) { url_ = url;} 31 void set_url(const GURL& url) { url_ = url;}
34 void set_perform_search_term_replacement( 32 void set_perform_search_term_replacement(
35 bool perform_search_term_replacement) { 33 bool perform_search_term_replacement) {
36 perform_search_term_replacement_ = perform_search_term_replacement; 34 perform_search_term_replacement_ = perform_search_term_replacement;
37 } 35 }
38 void set_security_level( 36 void set_security_level(SecurityLevel security_level) {
39 ConnectionSecurityHelper::SecurityLevel security_level) {
40 security_level_ = security_level; 37 security_level_ = security_level;
41 } 38 }
42 void set_icon(int icon) { icon_ = icon; } 39 void set_icon(int icon) { icon_ = icon; }
43 void set_ev_cert_name(const base::string16& ev_cert_name) { 40 void set_ev_cert_name(const base::string16& ev_cert_name) {
44 ev_cert_name_ = ev_cert_name; 41 ev_cert_name_ = ev_cert_name;
45 } 42 }
46 void set_should_display_url(bool should_display_url) { 43 void set_should_display_url(bool should_display_url) {
47 should_display_url_ = should_display_url; 44 should_display_url_ = should_display_url;
48 } 45 }
49 46
50 private: 47 private:
51 base::string16 text_; 48 base::string16 text_;
52 GURL url_; 49 GURL url_;
53 bool perform_search_term_replacement_; 50 bool perform_search_term_replacement_;
54 ConnectionSecurityHelper::SecurityLevel security_level_; 51 SecurityLevel security_level_;
55 int icon_; 52 int icon_;
56 base::string16 ev_cert_name_; 53 base::string16 ev_cert_name_;
57 bool should_display_url_; 54 bool should_display_url_;
58 55
59 DISALLOW_COPY_AND_ASSIGN(TestToolbarModel); 56 DISALLOW_COPY_AND_ASSIGN(TestToolbarModel);
60 }; 57 };
61 58
62 #endif // CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_ 59 #endif // CHROME_BROWSER_UI_TOOLBAR_TEST_TOOLBAR_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm ('k') | chrome/browser/ui/toolbar/test_toolbar_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698