Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_NOTIFICATION_ARC_PROVISION_NOTIFICATION_SERV ICE_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_NOTIFICATION_ARC_PROVISION_NOTIFICATION_SERV ICE_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | |
| 12 #include "components/arc/arc_service.h" | |
| 13 | |
| 14 namespace arc { | |
| 15 | |
| 16 // Watches for ARC provisioning status and displays a notification during | |
| 17 // provision when ARC OptIn happens silently due to enterprise policies. | |
| 18 class ArcProvisionNotificationService : public ArcService, | |
| 19 public ArcSessionManager::Observer { | |
| 20 public: | |
| 21 // The delegate whose methods are used by the service for showing/hiding the | |
| 22 // notifications. The delegate exists primarily for unit testing purposes. | |
| 23 class Delegate { | |
| 24 public: | |
| 25 virtual ~Delegate() {} | |
|
Luis Héctor Chávez
2017/03/13 15:50:41
nit: define in the .cc with = default.
emaxx
2017/03/16 18:32:12
Done.
| |
| 26 virtual void ShowManagedProvisionNotification() = 0; | |
| 27 virtual void RemoveManagedProvisionNotification() = 0; | |
| 28 }; | |
|
Luis Héctor Chávez
2017/03/13 15:50:41
nit: DISALLOW_COPY_AND_ASSIGN(Delegate);
emaxx
2017/03/16 18:32:12
Done.
But could you please explain what's the reas
Luis Héctor Chávez
2017/03/16 19:28:14
Just for consistency with the rest of the code.
| |
| 29 | |
| 30 explicit ArcProvisionNotificationService(ArcBridgeService* bridge_service); | |
| 31 ArcProvisionNotificationService(ArcBridgeService* bridge_service, | |
| 32 std::unique_ptr<Delegate> delegate); | |
| 33 ~ArcProvisionNotificationService() override; | |
| 34 | |
| 35 protected: | |
| 36 // ArcSessionManager::Observer: | |
| 37 void OnArcPlayStoreEnabledChanged(bool enabled) override; | |
| 38 void OnArcStartOptInAndroidManagementCheck() override; | |
| 39 void OnArcInitialStart() override; | |
| 40 void OnArcSessionStopped(ArcStopReason stop_reason) override; | |
| 41 void OnArcSupportHostErrorShown(ArcSupportHost::Error error) override; | |
| 42 | |
| 43 private: | |
| 44 std::unique_ptr<Delegate> delegate_; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(ArcProvisionNotificationService); | |
| 47 }; | |
| 48 | |
| 49 } // namespace arc | |
| 50 | |
| 51 #endif // CHROME_BROWSER_CHROMEOS_ARC_NOTIFICATION_ARC_PROVISION_NOTIFICATION_S ERVICE_H_ | |
| OLD | NEW |