| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "base/timer.h" | 16 #include "base/timer.h" |
| 17 #include "chrome/browser/extensions/crx_installer.h" | 17 #include "chrome/browser/extensions/crx_installer.h" |
| 18 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 18 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
| 19 #include "content/public/browser/notification_observer.h" | 19 #include "content/public/browser/notification_observer.h" |
| 20 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 21 | 21 |
| 22 namespace extensions { | 22 namespace extensions { |
| 23 | 23 |
| 24 // InstallLimiter defers big app installs after all small app installs and then | 24 // InstallLimiter defers big app installs after all small app installs and then |
| 25 // runs big app installs one by one. This improves first-time login experience. | 25 // runs big app installs one by one. This improves first-time login experience. |
| 26 // See http://crbug.com/166296 | 26 // See http://crbug.com/166296 |
| 27 class InstallLimiter : public ProfileKeyedService, | 27 class InstallLimiter : public BrowserContextKeyedService, |
| 28 public content::NotificationObserver, | 28 public content::NotificationObserver, |
| 29 public base::SupportsWeakPtr<InstallLimiter> { | 29 public base::SupportsWeakPtr<InstallLimiter> { |
| 30 public: | 30 public: |
| 31 static InstallLimiter* Get(Profile* profile); | 31 static InstallLimiter* Get(Profile* profile); |
| 32 | 32 |
| 33 InstallLimiter(); | 33 InstallLimiter(); |
| 34 virtual ~InstallLimiter(); | 34 virtual ~InstallLimiter(); |
| 35 | 35 |
| 36 void DisableForTest(); | 36 void DisableForTest(); |
| 37 | 37 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 base::OneShotTimer<InstallLimiter> wait_timer_; | 81 base::OneShotTimer<InstallLimiter> wait_timer_; |
| 82 | 82 |
| 83 bool disabled_for_test_; | 83 bool disabled_for_test_; |
| 84 | 84 |
| 85 DISALLOW_COPY_AND_ASSIGN(InstallLimiter); | 85 DISALLOW_COPY_AND_ASSIGN(InstallLimiter); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace extensions | 88 } // namespace extensions |
| 89 | 89 |
| 90 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ | 90 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_INSTALL_LIMITER_H_ |
| OLD | NEW |