| OLD | NEW |
| 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 COMPONENTS_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_ | 5 #ifndef COMPONENTS_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_ |
| 6 #define COMPONENTS_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_ | 6 #define COMPONENTS_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/memory/ref_counted.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "components/security_state/security_state_model.h" | 12 #include "components/security_state/security_state_model.h" |
| 13 | 13 |
| 14 class GURL; | 14 class GURL; |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 class X509Certificate; | 17 class X509Certificate; |
| 18 } | 18 } |
| 19 | 19 |
| 20 // Delegate which is used by ToolbarModel class. | 20 // Delegate which is used by ToolbarModel class. |
| 21 class ToolbarModelDelegate { | 21 class ToolbarModelDelegate { |
| 22 public: | 22 public: |
| 23 using SecurityLevel = security_state::SecurityStateModel::SecurityLevel; | 23 using SecurityLevel = security_state::SecurityStateModel::SecurityLevel; |
| 24 | 24 |
| 25 // Returns the value to use for the Accept-Languages HTTP header when making | |
| 26 // an HTTP request. | |
| 27 virtual std::string GetAcceptLanguages() const = 0; | |
| 28 | |
| 29 // Formats |url| using AutocompleteInput::FormattedStringWithEquivalentMeaning | 25 // Formats |url| using AutocompleteInput::FormattedStringWithEquivalentMeaning |
| 30 // providing an appropriate AutocompleteSchemeClassifier for the embedder. | 26 // providing an appropriate AutocompleteSchemeClassifier for the embedder. |
| 31 virtual base::string16 FormattedStringWithEquivalentMeaning( | 27 virtual base::string16 FormattedStringWithEquivalentMeaning( |
| 32 const GURL& url, | 28 const GURL& url, |
| 33 const base::string16& formatted_url) const = 0; | 29 const base::string16& formatted_url) const = 0; |
| 34 | 30 |
| 35 // Returns true and sets |url| to the current navigation entry URL if it | 31 // Returns true and sets |url| to the current navigation entry URL if it |
| 36 // exists. Otherwise returns false and leaves |url| unmodified. | 32 // exists. Otherwise returns false and leaves |url| unmodified. |
| 37 virtual bool GetURL(GURL* url) const = 0; | 33 virtual bool GetURL(GURL* url) const = 0; |
| 38 | 34 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 51 virtual base::string16 GetSearchTerms(SecurityLevel security_level) const = 0; | 47 virtual base::string16 GetSearchTerms(SecurityLevel security_level) const = 0; |
| 52 | 48 |
| 53 // Returns the certificate for the current navigation entry. | 49 // Returns the certificate for the current navigation entry. |
| 54 virtual scoped_refptr<net::X509Certificate> GetCertificate() const = 0; | 50 virtual scoped_refptr<net::X509Certificate> GetCertificate() const = 0; |
| 55 | 51 |
| 56 protected: | 52 protected: |
| 57 virtual ~ToolbarModelDelegate() {} | 53 virtual ~ToolbarModelDelegate() {} |
| 58 }; | 54 }; |
| 59 | 55 |
| 60 #endif // COMPONENTS_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_ | 56 #endif // COMPONENTS_TOOLBAR_TOOLBAR_MODEL_DELEGATE_H_ |
| OLD | NEW |