OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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_POLICY_CONSUMER_MANAGEMENT_NOTIFICATION_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_MANAGEMENT_NOTIFICATION_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/weak_ptr.h" | |
10 #include "chrome/browser/chromeos/policy/consumer_management_service.h" | |
11 #include "components/keyed_service/core/keyed_service.h" | |
12 | |
13 class Profile; | |
14 | |
15 namespace policy { | |
16 | |
17 // ConsumerManagementNotification observes ConsumerManagementService and shows | |
18 // a desktop notification to the device owner if consumer enrollment or | |
19 // unenrollment suceeds or fails. | |
20 class ConsumerManagementNotification | |
Mattias Nissler (ping if slow)
2014/11/18 10:02:27
Naming is a bit unfortunate here. This class' life
davidyu
2014/11/19 02:54:21
Done.
| |
21 : public KeyedService, | |
22 public ConsumerManagementService::Observer { | |
23 public: | |
24 ConsumerManagementNotification( | |
25 Profile* profile, | |
26 ConsumerManagementService* consumer_management_service); | |
27 virtual ~ConsumerManagementNotification(); | |
28 | |
29 virtual void Shutdown() override; | |
30 | |
31 // ConsumerManagementService::Observer: | |
32 virtual void OnConsumerManagementStatusChanged() override; | |
33 | |
34 private: | |
35 // Shows a desktop notification. | |
36 void ShowDesktopNotification( | |
37 ConsumerManagementService::EnrollmentStage stage); | |
38 | |
39 // Opens the settings page. | |
40 void OpenSettingsPage() const; | |
41 | |
42 // Opens the enrollment confirmation dialog in the settings page. | |
43 void TryEnrollmentAgain() const; | |
44 | |
45 Profile* profile_; | |
46 ConsumerManagementService* consumer_management_service_; | |
47 | |
48 base::WeakPtrFactory<ConsumerManagementNotification> weak_ptr_factory_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(ConsumerManagementNotification); | |
51 }; | |
52 | |
53 } // namespace policy | |
54 | |
55 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_MANAGEMENT_NOTIFICATION_H_ | |
OLD | NEW |