| 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 #ifndef CHROME_BROWSER_BACKGROUND_CONTENTS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_BACKGROUND_CONTENTS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_BACKGROUND_CONTENTS_SERVICE_H_ | 6 #define CHROME_BROWSER_BACKGROUND_CONTENTS_SERVICE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 void UnregisterBackgroundContents(BackgroundContents* contents); | 122 void UnregisterBackgroundContents(BackgroundContents* contents); |
| 123 | 123 |
| 124 // Unregisters and deletes the BackgroundContents associated with the | 124 // Unregisters and deletes the BackgroundContents associated with the |
| 125 // passed extension. | 125 // passed extension. |
| 126 void ShutdownAssociatedBackgroundContents(const string16& appid); | 126 void ShutdownAssociatedBackgroundContents(const string16& appid); |
| 127 | 127 |
| 128 // Returns true if this BackgroundContents is in the contents_list_. | 128 // Returns true if this BackgroundContents is in the contents_list_. |
| 129 bool IsTracked(BackgroundContents* contents) const; | 129 bool IsTracked(BackgroundContents* contents) const; |
| 130 | 130 |
| 131 // PrefService used to store list of background pages (or NULL if this is | 131 // PrefService used to store list of background pages (or NULL if this is |
| 132 // running under an off-the-record profile). | 132 // running under an incognito profile). |
| 133 PrefService* prefs_; | 133 PrefService* prefs_; |
| 134 NotificationRegistrar registrar_; | 134 NotificationRegistrar registrar_; |
| 135 | 135 |
| 136 // Information we track about each BackgroundContents. | 136 // Information we track about each BackgroundContents. |
| 137 struct BackgroundContentsInfo { | 137 struct BackgroundContentsInfo { |
| 138 // The BackgroundContents whose information we are tracking. | 138 // The BackgroundContents whose information we are tracking. |
| 139 BackgroundContents* contents; | 139 BackgroundContents* contents; |
| 140 // The name of the top level frame for this BackgroundContents. | 140 // The name of the top level frame for this BackgroundContents. |
| 141 string16 frame_name; | 141 string16 frame_name; |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 // Map associating currently loaded BackgroundContents with their parent | 144 // Map associating currently loaded BackgroundContents with their parent |
| 145 // applications. | 145 // applications. |
| 146 // Key: application id | 146 // Key: application id |
| 147 // Value: BackgroundContentsInfo for the BC associated with that application | 147 // Value: BackgroundContentsInfo for the BC associated with that application |
| 148 typedef std::map<string16, BackgroundContentsInfo> BackgroundContentsMap; | 148 typedef std::map<string16, BackgroundContentsInfo> BackgroundContentsMap; |
| 149 BackgroundContentsMap contents_map_; | 149 BackgroundContentsMap contents_map_; |
| 150 | 150 |
| 151 DISALLOW_COPY_AND_ASSIGN(BackgroundContentsService); | 151 DISALLOW_COPY_AND_ASSIGN(BackgroundContentsService); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 #endif // CHROME_BROWSER_BACKGROUND_CONTENTS_SERVICE_H_ | 154 #endif // CHROME_BROWSER_BACKGROUND_CONTENTS_SERVICE_H_ |
| OLD | NEW |