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 #include <algorithm> | 5 #include <algorithm> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 // treated as new installs. | 306 // treated as new installs. |
307 if (profile->GetExtensionService()->is_ready()) | 307 if (profile->GetExtensionService()->is_ready()) |
308 OnBackgroundAppInstalled(extension); | 308 OnBackgroundAppInstalled(extension); |
309 } | 309 } |
310 } | 310 } |
311 break; | 311 break; |
312 case chrome::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED: { | 312 case chrome::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED: { |
313 UpdatedExtensionPermissionsInfo* info = | 313 UpdatedExtensionPermissionsInfo* info = |
314 content::Details<UpdatedExtensionPermissionsInfo>(details).ptr(); | 314 content::Details<UpdatedExtensionPermissionsInfo>(details).ptr(); |
315 if (info->permissions->HasAPIPermission( | 315 if (info->permissions->HasAPIPermission( |
316 ExtensionAPIPermission::kBackground) && | 316 extensions::APIPermission::kBackground) && |
317 info->reason == UpdatedExtensionPermissionsInfo::ADDED) { | 317 info->reason == UpdatedExtensionPermissionsInfo::ADDED) { |
318 // Turned on background permission, so treat this as a new install. | 318 // Turned on background permission, so treat this as a new install. |
319 OnBackgroundAppInstalled(info->extension); | 319 OnBackgroundAppInstalled(info->extension); |
320 } | 320 } |
321 } | 321 } |
322 break; | 322 break; |
323 case content::NOTIFICATION_APP_TERMINATING: | 323 case content::NOTIFICATION_APP_TERMINATING: |
324 // Make sure we aren't still keeping the app alive (only happens if we | 324 // Make sure we aren't still keeping the app alive (only happens if we |
325 // don't receive an EXTENSIONS_READY notification for some reason). | 325 // don't receive an EXTENSIONS_READY notification for some reason). |
326 EndKeepAliveForStartup(); | 326 EndKeepAliveForStartup(); |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 } | 766 } |
767 } | 767 } |
768 return profile_it; | 768 return profile_it; |
769 } | 769 } |
770 | 770 |
771 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { | 771 bool BackgroundModeManager::IsBackgroundModePrefEnabled() const { |
772 PrefService* service = g_browser_process->local_state(); | 772 PrefService* service = g_browser_process->local_state(); |
773 DCHECK(service); | 773 DCHECK(service); |
774 return service->GetBoolean(prefs::kBackgroundModeEnabled); | 774 return service->GetBoolean(prefs::kBackgroundModeEnabled); |
775 } | 775 } |
OLD | NEW |