| 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_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_ |
| 6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_ | 6 #define CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 public BrowserContextKeyedService { | 54 public BrowserContextKeyedService { |
| 55 public: | 55 public: |
| 56 BackgroundContentsService(Profile* profile, const CommandLine* command_line); | 56 BackgroundContentsService(Profile* profile, const CommandLine* command_line); |
| 57 virtual ~BackgroundContentsService(); | 57 virtual ~BackgroundContentsService(); |
| 58 | 58 |
| 59 // Allows tests to reduce the time between a force-installed app/extension | 59 // Allows tests to reduce the time between a force-installed app/extension |
| 60 // crashing and when we reload it. | 60 // crashing and when we reload it. |
| 61 static void SetRestartDelayForForceInstalledAppsAndExtensionsForTesting( | 61 static void SetRestartDelayForForceInstalledAppsAndExtensionsForTesting( |
| 62 int restart_delay_in_ms); | 62 int restart_delay_in_ms); |
| 63 | 63 |
| 64 // Get the crash notification's id for the extension. |
| 65 static std::string GetNotificationIdForExtensionForTesting( |
| 66 const std::string& extension_id); |
| 67 |
| 68 // Show a popup notification balloon with a crash message for a given app/ |
| 69 // extension. |
| 70 static void ShowBalloonForTesting(const extensions::Extension* extension, |
| 71 Profile* profile); |
| 72 |
| 64 // Returns the BackgroundContents associated with the passed application id, | 73 // Returns the BackgroundContents associated with the passed application id, |
| 65 // or NULL if none. | 74 // or NULL if none. |
| 66 BackgroundContents* GetAppBackgroundContents(const base::string16& appid); | 75 BackgroundContents* GetAppBackgroundContents(const base::string16& appid); |
| 67 | 76 |
| 68 // Returns true if there's a registered BackgroundContents for this app. It | 77 // Returns true if there's a registered BackgroundContents for this app. It |
| 69 // is possible for this routine to return true when GetAppBackgroundContents() | 78 // is possible for this routine to return true when GetAppBackgroundContents() |
| 70 // returns false, if the BackgroundContents closed due to the render process | 79 // returns false, if the BackgroundContents closed due to the render process |
| 71 // crashing. | 80 // crashing. |
| 72 bool HasRegisteredBackgroundContents(const base::string16& appid); | 81 bool HasRegisteredBackgroundContents(const base::string16& appid); |
| 73 | 82 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 // Key: application id | 214 // Key: application id |
| 206 // Value: BackgroundContentsInfo for the BC associated with that application | 215 // Value: BackgroundContentsInfo for the BC associated with that application |
| 207 typedef std::map<base::string16, BackgroundContentsInfo> | 216 typedef std::map<base::string16, BackgroundContentsInfo> |
| 208 BackgroundContentsMap; | 217 BackgroundContentsMap; |
| 209 BackgroundContentsMap contents_map_; | 218 BackgroundContentsMap contents_map_; |
| 210 | 219 |
| 211 DISALLOW_COPY_AND_ASSIGN(BackgroundContentsService); | 220 DISALLOW_COPY_AND_ASSIGN(BackgroundContentsService); |
| 212 }; | 221 }; |
| 213 | 222 |
| 214 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_ | 223 #endif // CHROME_BROWSER_BACKGROUND_BACKGROUND_CONTENTS_SERVICE_H_ |
| OLD | NEW |