extension_web_ui_override_registrar.h revision a1401311d1ab56c4ed0a474bd38c108f75cb0cd9
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_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ 6#define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ 7 8#include "base/basictypes.h" 9#include "content/public/browser/notification_observer.h" 10#include "content/public/browser/notification_registrar.h" 11#include "extensions/browser/browser_context_keyed_api_factory.h" 12 13class Profile; 14 15namespace content { 16class BrowserContext; 17} 18 19namespace extensions { 20 21class ExtensionWebUIOverrideRegistrar : public BrowserContextKeyedAPI, 22 public content::NotificationObserver { 23 public: 24 explicit ExtensionWebUIOverrideRegistrar(content::BrowserContext* context); 25 virtual ~ExtensionWebUIOverrideRegistrar(); 26 27 // BrowserContextKeyedAPI implementation. 28 static BrowserContextKeyedAPIFactory<ExtensionWebUIOverrideRegistrar>* 29 GetFactoryInstance(); 30 31 // content::NotificationObserver implementation. 32 virtual void Observe(int type, 33 const content::NotificationSource& source, 34 const content::NotificationDetails& details) OVERRIDE; 35 36 private: 37 friend class BrowserContextKeyedAPIFactory<ExtensionWebUIOverrideRegistrar>; 38 39 // BrowserContextKeyedAPI implementation. 40 static const char* service_name() { 41 return "ExtensionWebUIOverrideRegistrar"; 42 } 43 44 Profile* const profile_; 45 content::NotificationRegistrar registrar_; 46 47 DISALLOW_COPY_AND_ASSIGN(ExtensionWebUIOverrideRegistrar); 48}; 49 50} // namespace extensions 51 52#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEB_UI_OVERRIDE_REGISTRAR_H_ 53