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

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

Issue 1652153003: Move toolbar_model_{impl,delegate}.{cc,h} to components/toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@3
Patch Set: Add static_cast<int> to fix compilation warning on Win 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 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_IMPL_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_IMPL_H_
7
8 #include <stddef.h>
9
10 #include <string>
11
12 #include "base/compiler_specific.h"
13 #include "base/macros.h"
14 #include "base/strings/string16.h"
15 #include "components/toolbar/toolbar_model.h"
16 #include "url/gurl.h"
17
18 class ToolbarModelDelegate;
19
20 namespace content {
21 class NavigationController;
22 class WebContents;
23 }
24
25 namespace net {
26 class X509Certificate;
27 }
28
29 // This class is the model used by the toolbar, location bar and autocomplete
30 // edit. It populates its states from the current navigation entry retrieved
31 // from the navigation controller returned by GetNavigationController().
32 class ToolbarModelImpl : public ToolbarModel {
33 public:
34 ToolbarModelImpl(ToolbarModelDelegate* delegate,
35 size_t max_url_display_chars);
36 ~ToolbarModelImpl() override;
37
38 private:
39 // ToolbarModel:
40 base::string16 GetText() const override;
41 base::string16 GetFormattedURL(size_t* prefix_end) const override;
42 base::string16 GetCorpusNameForMobile() const override;
43 GURL GetURL() const override;
44 bool WouldPerformSearchTermReplacement(bool ignore_editing) const override;
45 security_state::SecurityStateModel::SecurityLevel GetSecurityLevel(
46 bool ignore_editing) const override;
47 int GetIcon() const override;
48 gfx::VectorIconId GetVectorIcon() const override;
49 base::string16 GetEVCertName() const override;
50 bool ShouldDisplayURL() const override;
51
52 // Returns search terms as in search::GetSearchTerms() if such terms should
53 // appear in the omnibox (i.e. the page is sufficiently secure, search term
54 // replacement is enabled, editing is not in progress, etc.). If
55 // |ignore_editing| is true, the "editing not in progress" check is skipped.
56 base::string16 GetSearchTerms(bool ignore_editing) const;
57
58 ToolbarModelDelegate* delegate_;
59 const size_t max_url_display_chars_;
60
61 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarModelImpl);
62 };
63
64 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model_delegate.h ('k') | chrome/browser/ui/toolbar/toolbar_model_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698