Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: chrome/browser/chromeos/policy/consumer_management_notification.h

Issue 733613005: Move the notification part out of ConsumerEnrollmentHandler so that it can be reused for unenrollme… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enroll
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698