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

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

Issue 1653013002: Abstract ToolbarModelImpl dependencies on //content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1
Patch Set: Fix compilation on Mac 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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_TOOLBAR_MODEL_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/ref_counted.h"
10 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "components/security_state/security_state_model.h"
11 13
12 class GURL; 14 class GURL;
13 15
14 namespace content { 16 namespace content {
15 class WebContents; 17 class WebContents;
16 } 18 }
17 19
20 namespace net {
21 class X509Certificate;
22 }
23
18 // Delegate which is used by ToolbarModel class. 24 // Delegate which is used by ToolbarModel class.
19 class ToolbarModelDelegate { 25 class ToolbarModelDelegate {
20 public: 26 public:
21 // Returns active WebContents. 27 typedef security_state::SecurityStateModel::SecurityLevel SecurityLevel;
Peter Kasting 2016/02/02 23:51:30 Nit: Prefer type aliases to typedefs
sdefresne 2016/02/03 13:14:17 Done.
22 virtual content::WebContents* GetActiveWebContents() const = 0;
23 28
24 // Returns the value to use for Accept-Languages HTTP header when making an 29 // Returns the value to use for Accept-Languages HTTP header when making an
25 // HTTP request. 30 // HTTP request.
26 virtual std::string GetAcceptLanguages() const = 0; 31 virtual std::string GetAcceptLanguages() const = 0;
27 32
28 // Formats |url| using AutocompleteInput::FormattedStringWithEquivalentMeaning 33 // Formats |url| using AutocompleteInput::FormattedStringWithEquivalentMeaning
29 // providing an appropriate AutocompleteSchemeClassifier for the embedder. 34 // providing an appropriate AutocompleteSchemeClassifier for the embedder.
30 virtual base::string16 FormattedStringWithEquivalentMeaning( 35 virtual base::string16 FormattedStringWithEquivalentMeaning(
31 const GURL& url, 36 const GURL& url,
32 const base::string16& formatted_url) const = 0; 37 const base::string16& formatted_url) const = 0;
33 38
39 // Returns true and set |url| to the current navigation entry URL if it
Peter Kasting 2016/02/02 23:51:30 Nit: sets
40 // exists. Otherwise returns false and leaves |url| unmodified.
41 virtual bool GetURL(GURL* url) const = 0;
42
43 // Returns whether the URL for the current navigation entry should be
44 // in the location bar.
Peter Kasting 2016/02/02 23:51:30 Nit: should be displayed in
sdefresne 2016/02/03 13:14:17 Done.
45 virtual bool ShouldDisplayURL() const = 0;
46
47 // Returns the underlying security level of the page without regard to any
48 // user edits that may be in progress.
49 virtual SecurityLevel GetSecurityLevel() const = 0;
50
51 // Returns search terms as in search::GetSearchTerms() if such terms should
52 // appear in the omnibox (i.e. the page is sufficiently secure, search term
53 // replacement is enabled, editing is not in progress, etc.) given that the
54 // page has a security level of |security_level|.
55 virtual base::string16 GetSearchTerms(SecurityLevel security_level) const = 0;
56
57 // Returns the certificate for the current navigation entry.
58 virtual scoped_refptr<net::X509Certificate> GetCertificate() const = 0;
59
34 protected: 60 protected:
35 virtual ~ToolbarModelDelegate() {} 61 virtual ~ToolbarModelDelegate() {}
36 }; 62 };
37 63
38 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_ 64 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698