| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SYNC_BACKGROUND_SYNC_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_CONTROLLER_IMPL_H_ |
| 6 #define CHROME_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_CONTROLLER_IMPL_H_ |
| 7 | 7 |
| 8 #include "content/public/browser/background_sync_controller.h" | 8 #include "content/public/browser/background_sync_controller.h" |
| 9 | 9 |
| 10 #include <stdint.h> | 10 #include <stdint.h> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "components/keyed_service/core/keyed_service.h" | 13 #include "components/keyed_service/core/keyed_service.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 struct BackgroundSyncParameters; | 17 struct BackgroundSyncParameters; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace rappor { | 20 namespace rappor { |
| 21 class RapporService; | 21 class RapporServiceImpl; |
| 22 } | 22 } |
| 23 | 23 |
| 24 class Profile; | 24 class Profile; |
| 25 | 25 |
| 26 class BackgroundSyncControllerImpl : public content::BackgroundSyncController, | 26 class BackgroundSyncControllerImpl : public content::BackgroundSyncController, |
| 27 public KeyedService { | 27 public KeyedService { |
| 28 public: | 28 public: |
| 29 static const char kFieldTrialName[]; | 29 static const char kFieldTrialName[]; |
| 30 static const char kDisabledParameterName[]; | 30 static const char kDisabledParameterName[]; |
| 31 static const char kMaxAttemptsParameterName[]; | 31 static const char kMaxAttemptsParameterName[]; |
| 32 static const char kInitialRetryParameterName[]; | 32 static const char kInitialRetryParameterName[]; |
| 33 static const char kRetryDelayFactorParameterName[]; | 33 static const char kRetryDelayFactorParameterName[]; |
| 34 static const char kMinSyncRecoveryTimeName[]; | 34 static const char kMinSyncRecoveryTimeName[]; |
| 35 static const char kMaxSyncEventDurationName[]; | 35 static const char kMaxSyncEventDurationName[]; |
| 36 | 36 |
| 37 explicit BackgroundSyncControllerImpl(Profile* profile); | 37 explicit BackgroundSyncControllerImpl(Profile* profile); |
| 38 ~BackgroundSyncControllerImpl() override; | 38 ~BackgroundSyncControllerImpl() override; |
| 39 | 39 |
| 40 // content::BackgroundSyncController overrides. | 40 // content::BackgroundSyncController overrides. |
| 41 void GetParameterOverrides( | 41 void GetParameterOverrides( |
| 42 content::BackgroundSyncParameters* parameters) const override; | 42 content::BackgroundSyncParameters* parameters) const override; |
| 43 void NotifyBackgroundSyncRegistered(const GURL& origin) override; | 43 void NotifyBackgroundSyncRegistered(const GURL& origin) override; |
| 44 void RunInBackground(bool enabled, int64_t min_ms) override; | 44 void RunInBackground(bool enabled, int64_t min_ms) override; |
| 45 | 45 |
| 46 protected: | 46 protected: |
| 47 // Virtual for testing. | 47 // Virtual for testing. |
| 48 virtual rappor::RapporService* GetRapporService(); | 48 virtual rappor::RapporServiceImpl* GetRapporServiceImpl(); |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 Profile* profile_; // This object is owned by profile_. | 51 Profile* profile_; // This object is owned by profile_. |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncControllerImpl); | 53 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncControllerImpl); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 #endif // CHROME_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_CONTROLLER_IMPL_H_ | 56 #endif // CHROME_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_CONTROLLER_IMPL_H_ |
| OLD | NEW |