| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Defines the Chrome Extensions WebNavigation API functions for observing and | 5 // Defines the Chrome Extensions WebNavigation API functions for observing and |
| 6 // intercepting navigation events, as specified in | 6 // intercepting navigation events, as specified in |
| 7 // chrome/common/extensions/api/extension_api.json. | 7 // chrome/common/extensions/api/extension_api.json. |
| 8 | 8 |
| 9 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 9 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
| 10 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 10 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
| 11 #pragma once | 11 #pragma once |
| 12 | 12 |
| 13 #include <map> |
| 14 |
| 13 #include "base/singleton.h" | 15 #include "base/singleton.h" |
| 14 #include "chrome/browser/extensions/extension_function.h" | 16 #include "chrome/browser/extensions/extension_function.h" |
| 15 #include "chrome/common/notification_observer.h" | 17 #include "chrome/common/notification_observer.h" |
| 16 #include "chrome/common/notification_registrar.h" | 18 #include "chrome/common/notification_registrar.h" |
| 17 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
| 18 | 20 |
| 19 class NavigationController; | 21 class NavigationController; |
| 20 class ProvisionalLoadDetails; | 22 class ProvisionalLoadDetails; |
| 23 class TabContents; |
| 21 | 24 |
| 22 // Observes navigation notifications and routes them as events to the extension | 25 // Observes navigation notifications and routes them as events to the extension |
| 23 // system. | 26 // system. |
| 24 class ExtensionWebNavigationEventRouter : public NotificationObserver { | 27 class ExtensionWebNavigationEventRouter : public NotificationObserver { |
| 25 public: | 28 public: |
| 26 // Single instance of the event router. | 29 // Single instance of the event router. |
| 27 static ExtensionWebNavigationEventRouter* GetInstance(); | 30 static ExtensionWebNavigationEventRouter* GetInstance(); |
| 28 | 31 |
| 29 void Init(); | 32 void Init(); |
| 30 | 33 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 const char* event_name, | 65 const char* event_name, |
| 63 const std::string& json_args); | 66 const std::string& json_args); |
| 64 | 67 |
| 65 // Used for tracking registrations to navigation notifications. | 68 // Used for tracking registrations to navigation notifications. |
| 66 NotificationRegistrar registrar_; | 69 NotificationRegistrar registrar_; |
| 67 | 70 |
| 68 DISALLOW_COPY_AND_ASSIGN(ExtensionWebNavigationEventRouter); | 71 DISALLOW_COPY_AND_ASSIGN(ExtensionWebNavigationEventRouter); |
| 69 }; | 72 }; |
| 70 | 73 |
| 71 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ | 74 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WEBNAVIGATION_API_H_ |
| OLD | NEW |