OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_ | |
6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/memory/ref_counted.h" | |
11 #include "base/strings/string16.h" | |
12 #include "components/security_state/security_state_model.h" | |
13 | |
14 class GURL; | |
15 | |
16 namespace content { | |
17 class WebContents; | |
18 } | |
19 | |
20 namespace net { | |
21 class X509Certificate; | |
22 } | |
23 | |
24 // Delegate which is used by ToolbarModel class. | |
25 class ToolbarModelDelegate { | |
26 public: | |
27 typedef security_state::SecurityStateModel::SecurityLevel SecurityLevel; | |
28 | |
29 // Returns the value to use for Accept-Languages HTTP header when making an | |
30 // HTTP request. | |
31 virtual std::string GetAcceptLanguages() const = 0; | |
32 | |
33 // Formats |url| using AutocompleteInput::FormattedStringWithEquivalentMeaning | |
34 // providing an appropriate AutocompleteSchemeClassifier for the embedder. | |
35 virtual base::string16 FormattedStringWithEquivalentMeaning( | |
36 const GURL& url, | |
37 const base::string16& formatted_url) const = 0; | |
38 | |
39 // Returns true and set |url| to the current navigation entry URL if it | |
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. | |
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 | |
60 protected: | |
61 virtual ~ToolbarModelDelegate() {} | |
62 }; | |
63 | |
64 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_ | |
OLD | NEW |