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_NOTIFIER_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_MANAGEMENT_NOTIFIER_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 // ConsumerManagementNotifier observes ConsumerManagementService and shows | |
18 // a desktop notification to the device owner if consumer enrollment or | |
19 // unenrollment suceeds or fails. | |
20 class ConsumerManagementNotifier | |
21 : public KeyedService, | |
22 public ConsumerManagementService::Observer { | |
23 public: | |
24 ConsumerManagementNotifier( | |
25 Profile* profile, | |
26 ConsumerManagementService* consumer_management_service); | |
27 virtual ~ConsumerManagementNotifier(); | |
bartfab (slow)
2014/11/27 14:09:09
Nit: Use |override| instead of |virtual|.
davidyu
2014/11/28 02:45:26
Done.
| |
28 | |
29 virtual void Shutdown() override; | |
bartfab (slow)
2014/11/27 14:09:09
Nit: No |virtual| with |override|.
davidyu
2014/11/28 02:45:26
Done.
| |
30 | |
31 // ConsumerManagementService::Observer: | |
32 virtual void OnConsumerManagementStatusChanged() override; | |
bartfab (slow)
2014/11/27 14:09:09
Nit: No |virtual| with |override|.
davidyu
2014/11/28 02:45:26
Done.
| |
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<ConsumerManagementNotifier> weak_ptr_factory_; | |
49 | |
50 DISALLOW_COPY_AND_ASSIGN(ConsumerManagementNotifier); | |
51 }; | |
52 | |
53 } // namespace policy | |
54 | |
55 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONSUMER_MANAGEMENT_NOTIFIER_H_ | |
OLD | NEW |