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

Side by Side Diff: chrome/browser/extensions/external_provider_interface.h

Issue 12093036: Move Extension Location and Type enums to Manifest, and move InstallWarning to its own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
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_EXTENSIONS_EXTERNAL_PROVIDER_INTERFACE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_INTERFACE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_INTERFACE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_INTERFACE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
11 #include "chrome/common/extensions/extension.h" 11 #include "chrome/common/extensions/manifest.h"
12 #include "googleurl/src/gurl.h"
Jeffrey Yasskin 2013/01/29 22:54:07 Strictly, GURL could be a forward declaration here
Yoyo Zhou 2013/01/30 01:16:01 Done.
12 13
13 class FilePath; 14 class FilePath;
14 class Version; 15 class Version;
15 16
16 namespace extensions { 17 namespace extensions {
17 18
18 // This class is an abstract class for implementing external extensions 19 // This class is an abstract class for implementing external extensions
19 // providers. 20 // providers.
20 class ExternalProviderInterface { 21 class ExternalProviderInterface {
21 public: 22 public:
22 // ExternalProvider uses this interface to communicate back to the 23 // ExternalProvider uses this interface to communicate back to the
23 // caller what extensions are registered, and which |id|, |version| and |path| 24 // caller what extensions are registered, and which |id|, |version| and |path|
24 // they have. See also VisitRegisteredExtension below. Ownership of |version| 25 // they have. See also VisitRegisteredExtension below. Ownership of |version|
25 // is not transferred to the visitor. Callers of the methods below must 26 // is not transferred to the visitor. Callers of the methods below must
26 // ensure that |id| is a valid extension id (use Extension::IdIsValid(id)). 27 // ensure that |id| is a valid extension id (use Extension::IdIsValid(id)).
27 class VisitorInterface { 28 class VisitorInterface {
28 public: 29 public:
29 // Return true if the extension install will proceed. Install will not 30 // Return true if the extension install will proceed. Install will not
30 // proceed if the extension is already installed from a higher priority 31 // proceed if the extension is already installed from a higher priority
31 // location. 32 // location.
32 virtual bool OnExternalExtensionFileFound( 33 virtual bool OnExternalExtensionFileFound(
33 const std::string& id, 34 const std::string& id,
34 const Version* version, 35 const Version* version,
35 const FilePath& path, 36 const FilePath& path,
36 Extension::Location location, 37 Manifest::Location location,
37 int creation_flags, 38 int creation_flags,
38 bool mark_acknowledged) = 0; 39 bool mark_acknowledged) = 0;
39 40
40 // Return true if the extension install will proceed. Install might not 41 // Return true if the extension install will proceed. Install might not
41 // proceed if the extension is already installed from a higher priority 42 // proceed if the extension is already installed from a higher priority
42 // location. 43 // location.
43 virtual bool OnExternalExtensionUpdateUrlFound( 44 virtual bool OnExternalExtensionUpdateUrlFound(
44 const std::string& id, 45 const std::string& id,
45 const GURL& update_url, 46 const GURL& update_url,
46 Extension::Location location) = 0; 47 Manifest::Location location) = 0;
47 48
48 // Called after all the external extensions have been reported 49 // Called after all the external extensions have been reported
49 // through the above two methods. |provider| is a pointer to the 50 // through the above two methods. |provider| is a pointer to the
50 // provider that is now ready (typically this), and the 51 // provider that is now ready (typically this), and the
51 // implementation of OnExternalProviderReady() should be able to 52 // implementation of OnExternalProviderReady() should be able to
52 // safely assert that provider->IsReady(). 53 // safely assert that provider->IsReady().
53 virtual void OnExternalProviderReady( 54 virtual void OnExternalProviderReady(
54 const ExternalProviderInterface* provider) = 0; 55 const ExternalProviderInterface* provider) = 0;
55 56
56 protected: 57 protected:
(...skipping 11 matching lines...) Expand all
68 virtual void VisitRegisteredExtension() = 0; 69 virtual void VisitRegisteredExtension() = 0;
69 70
70 // Test if this provider has an extension with id |id| registered. 71 // Test if this provider has an extension with id |id| registered.
71 virtual bool HasExtension(const std::string& id) const = 0; 72 virtual bool HasExtension(const std::string& id) const = 0;
72 73
73 // Gets details of an extension by its id. Output params will be set only 74 // Gets details of an extension by its id. Output params will be set only
74 // if they are not NULL. If an output parameter is not specified by the 75 // if they are not NULL. If an output parameter is not specified by the
75 // provider type, it will not be changed. 76 // provider type, it will not be changed.
76 // This function is no longer used outside unit tests. 77 // This function is no longer used outside unit tests.
77 virtual bool GetExtensionDetails(const std::string& id, 78 virtual bool GetExtensionDetails(const std::string& id,
78 Extension::Location* location, 79 Manifest::Location* location,
79 scoped_ptr<Version>* version) const = 0; 80 scoped_ptr<Version>* version) const = 0;
80 81
81 // Determines if this provider had loaded the list of external extensions 82 // Determines if this provider had loaded the list of external extensions
82 // from its source. 83 // from its source.
83 virtual bool IsReady() const = 0; 84 virtual bool IsReady() const = 0;
84 }; 85 };
85 86
86 typedef std::vector<linked_ptr<ExternalProviderInterface> > 87 typedef std::vector<linked_ptr<ExternalProviderInterface> >
87 ProviderCollection; 88 ProviderCollection;
88 89
89 } // namespace extensions 90 } // namespace extensions
90 91
91 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_INTERFACE_H_ 92 #endif // CHROME_BROWSER_EXTENSIONS_EXTERNAL_PROVIDER_INTERFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698