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

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

Issue 1634743003: Componentize TestToolbarModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix gyp dependency Created 4 years, 10 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
(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/test_toolbar_model.h"
6
7 #include "grit/components_scaled_resources.h"
8 #include "ui/gfx/vector_icons_public.h"
9
10 TestToolbarModel::TestToolbarModel()
11 : perform_search_term_replacement_(false),
12 security_level_(security_state::SecurityStateModel::NONE),
13 #if defined(TOOLKIT_VIEWS)
14 icon_(gfx::VectorIconId::LOCATION_BAR_HTTP),
15 #else
16 icon_(gfx::VectorIconId::VECTOR_ICON_NONE),
17 #endif
18 should_display_url_(true) {
19 }
20
21 TestToolbarModel::~TestToolbarModel() {}
22
23 base::string16 TestToolbarModel::GetText() const {
24 return text_;
25 }
26
27 base::string16 TestToolbarModel::GetFormattedURL(size_t* prefix_end) const {
28 return text_;
29 }
30
31 base::string16 TestToolbarModel::GetCorpusNameForMobile() const {
32 return base::string16();
33 }
34
35 GURL TestToolbarModel::GetURL() const {
36 return url_;
37 }
38
39 bool TestToolbarModel::WouldPerformSearchTermReplacement(
40 bool ignore_editing) const {
41 return perform_search_term_replacement_;
42 }
43
44 security_state::SecurityStateModel::SecurityLevel
45 TestToolbarModel::GetSecurityLevel(bool ignore_editing) const {
46 return security_level_;
47 }
48
49 int TestToolbarModel::GetIcon() const {
50 // This placeholder implementation should be removed when MD is default.
51 return IDR_LOCATION_BAR_HTTP;
52 }
53
54 gfx::VectorIconId TestToolbarModel::GetVectorIcon() const {
55 return icon_;
56 }
57
58 base::string16 TestToolbarModel::GetEVCertName() const {
59 return (security_level_ == security_state::SecurityStateModel::EV_SECURE)
60 ? ev_cert_name_
61 : base::string16();
62 }
63
64 bool TestToolbarModel::ShouldDisplayURL() const {
65 return should_display_url_;
66 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/test_toolbar_model.h ('k') | chrome/browser/ui/views/frame/web_app_left_header_view_ash_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698