| 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_MANIFEST_URL_PARSER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_MANIFEST_URL_PARSER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_MANIFEST_URL_PARSER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_MANIFEST_URL_PARSER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" | 9 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h" |
| 10 #include "content/public/browser/notification_observer.h" |
| 11 #include "content/public/browser/notification_registrar.h" |
| 10 | 12 |
| 11 class Profile; | 13 class Profile; |
| 12 | 14 |
| 13 namespace extensions { | 15 namespace extensions { |
| 14 | 16 |
| 15 class ManifestURLParser : public ProfileKeyedAPI { | 17 class ManifestURLParser : public ProfileKeyedAPI, |
| 18 public content::NotificationObserver { |
| 16 public: | 19 public: |
| 17 explicit ManifestURLParser(Profile* profile); | 20 explicit ManifestURLParser(Profile* profile); |
| 18 virtual ~ManifestURLParser(); | 21 virtual ~ManifestURLParser(); |
| 19 | 22 |
| 20 // ProfileKeyedAPI implementation. | 23 // ProfileKeyedAPI implementation. |
| 21 static ProfileKeyedAPIFactory<ManifestURLParser>* GetFactoryInstance(); | 24 static ProfileKeyedAPIFactory<ManifestURLParser>* GetFactoryInstance(); |
| 22 | 25 |
| 26 // content::NotificationObserver implementation. |
| 27 virtual void Observe(int type, |
| 28 const content::NotificationSource& source, |
| 29 const content::NotificationDetails& details) OVERRIDE; |
| 30 |
| 23 private: | 31 private: |
| 24 friend class ProfileKeyedAPIFactory<ManifestURLParser>; | 32 friend class ProfileKeyedAPIFactory<ManifestURLParser>; |
| 25 | 33 |
| 26 // ProfileKeyedAPI implementation. | 34 // ProfileKeyedAPI implementation. |
| 27 static const char* service_name() { | 35 static const char* service_name() { |
| 28 return "ManifestURLParser"; | 36 return "ManifestURLParser"; |
| 29 } | 37 } |
| 30 static const bool kServiceIsNULLWhileTesting = true; | 38 static const bool kServiceIsNULLWhileTesting = true; |
| 31 | 39 |
| 40 Profile* const profile_; |
| 41 content::NotificationRegistrar registrar_; |
| 42 |
| 32 DISALLOW_COPY_AND_ASSIGN(ManifestURLParser); | 43 DISALLOW_COPY_AND_ASSIGN(ManifestURLParser); |
| 33 }; | 44 }; |
| 34 | 45 |
| 35 } // namespace extensions | 46 } // namespace extensions |
| 36 | 47 |
| 37 #endif // CHROME_BROWSER_EXTENSIONS_MANIFEST_URL_PARSER_H_ | 48 #endif // CHROME_BROWSER_EXTENSIONS_MANIFEST_URL_PARSER_H_ |
| OLD | NEW |