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 CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "chrome/browser/extensions/external_provider_interface.h" | 10 #include "chrome/browser/extensions/external_provider_interface.h" |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "chrome/browser/extensions/external_loader.h" | 13 #include "chrome/browser/extensions/external_loader.h" |
14 #include "chrome/common/extensions/manifest.h" | 14 #include "chrome/common/extensions/manifest.h" |
15 | 15 |
16 class Profile; | 16 class Profile; |
17 class Version; | |
18 | 17 |
19 namespace base { | 18 namespace base { |
20 class DictionaryValue; | 19 class DictionaryValue; |
| 20 class Version; |
21 } | 21 } |
22 | 22 |
23 namespace extensions { | 23 namespace extensions { |
24 class ExternalLoader; | 24 class ExternalLoader; |
25 | 25 |
26 // A specialization of the ExternalProvider that uses an instance of | 26 // A specialization of the ExternalProvider that uses an instance of |
27 // ExternalLoader to provide external extensions. This class can be seen as a | 27 // ExternalLoader to provide external extensions. This class can be seen as a |
28 // bridge between the extension system and an ExternalLoader. Instances live | 28 // bridge between the extension system and an ExternalLoader. Instances live |
29 // their entire life on the UI thread. | 29 // their entire life on the UI thread. |
30 class ExternalProviderImpl : public ExternalProviderInterface { | 30 class ExternalProviderImpl : public ExternalProviderInterface { |
(...skipping 20 matching lines...) Expand all Loading... |
51 ProviderCollection* provider_list); | 51 ProviderCollection* provider_list); |
52 | 52 |
53 // Sets underlying prefs and notifies provider. Only to be called by the | 53 // Sets underlying prefs and notifies provider. Only to be called by the |
54 // owned ExternalLoader instance. | 54 // owned ExternalLoader instance. |
55 virtual void SetPrefs(base::DictionaryValue* prefs); | 55 virtual void SetPrefs(base::DictionaryValue* prefs); |
56 | 56 |
57 // ExternalProvider implementation: | 57 // ExternalProvider implementation: |
58 virtual void ServiceShutdown() OVERRIDE; | 58 virtual void ServiceShutdown() OVERRIDE; |
59 virtual void VisitRegisteredExtension() OVERRIDE; | 59 virtual void VisitRegisteredExtension() OVERRIDE; |
60 virtual bool HasExtension(const std::string& id) const OVERRIDE; | 60 virtual bool HasExtension(const std::string& id) const OVERRIDE; |
61 virtual bool GetExtensionDetails(const std::string& id, | 61 virtual bool GetExtensionDetails( |
62 Manifest::Location* location, | 62 const std::string& id, |
63 scoped_ptr<Version>* version) const OVERRIDE; | 63 Manifest::Location* location, |
| 64 scoped_ptr<base::Version>* version) const OVERRIDE; |
64 | 65 |
65 virtual bool IsReady() const OVERRIDE; | 66 virtual bool IsReady() const OVERRIDE; |
66 | 67 |
67 static const char kExternalCrx[]; | 68 static const char kExternalCrx[]; |
68 static const char kExternalVersion[]; | 69 static const char kExternalVersion[]; |
69 static const char kExternalUpdateUrl[]; | 70 static const char kExternalUpdateUrl[]; |
70 static const char kSupportedLocales[]; | 71 static const char kSupportedLocales[]; |
71 static const char kIsBookmarkApp[]; | 72 static const char kIsBookmarkApp[]; |
72 static const char kIsFromWebstore[]; | 73 static const char kIsFromWebstore[]; |
73 | 74 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Whether loaded extensions should be automatically acknowledged, so that | 107 // Whether loaded extensions should be automatically acknowledged, so that |
107 // the user doesn't see an alert about them. | 108 // the user doesn't see an alert about them. |
108 bool auto_acknowledge_; | 109 bool auto_acknowledge_; |
109 | 110 |
110 DISALLOW_COPY_AND_ASSIGN(ExternalProviderImpl); | 111 DISALLOW_COPY_AND_ASSIGN(ExternalProviderImpl); |
111 }; | 112 }; |
112 | 113 |
113 } // namespace extensions | 114 } // namespace extensions |
114 | 115 |
115 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ | 116 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_IMPL_H_ |
OLD | NEW |