| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #include "chrome/browser/chromeos/policy/consumer_management_service.h" | 5 #include "chrome/browser/chromeos/policy/consumer_management_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 // Desktop notification constants. | 61 // Desktop notification constants. |
| 62 const char kEnrollmentNotificationId[] = "consumer_management.enroll"; | 62 const char kEnrollmentNotificationId[] = "consumer_management.enroll"; |
| 63 const char kEnrollmentNotificationUrl[] = "chrome://consumer-management/enroll"; | 63 const char kEnrollmentNotificationUrl[] = "chrome://consumer-management/enroll"; |
| 64 | 64 |
| 65 // The path to the consumer management enrollment/unenrollment confirmation | 65 // The path to the consumer management enrollment/unenrollment confirmation |
| 66 // overlay, relative to the settings page URL. | 66 // overlay, relative to the settings page URL. |
| 67 const char kConsumerManagementOverlay[] = "consumer-management-overlay"; | 67 const char kConsumerManagementOverlay[] = "consumer-management-overlay"; |
| 68 | 68 |
| 69 // Returns the account ID signed in to |profile|. | 69 // Returns the account ID signed in to |profile|. |
| 70 const std::string& GetAccountIdFromProfile(Profile* profile) { | 70 std::string GetAccountIdFromProfile(Profile* profile) { |
| 71 return SigninManagerFactory::GetForProfile(profile)-> | 71 return SigninManagerFactory::GetForProfile(profile)-> |
| 72 GetAuthenticatedAccountId(); | 72 GetAuthenticatedAccountId(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 class DesktopNotificationDelegate : public NotificationDelegate { | 75 class DesktopNotificationDelegate : public NotificationDelegate { |
| 76 public: | 76 public: |
| 77 // |button_click_callback| is called when the button in the notification is | 77 // |button_click_callback| is called when the button in the notification is |
| 78 // clicked. | 78 // clicked. |
| 79 DesktopNotificationDelegate(const std::string& id, | 79 DesktopNotificationDelegate(const std::string& id, |
| 80 const base::Closure& button_click_callback); | 80 const base::Closure& button_click_callback); |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 chrome::NavigateParams params(profile, url, ui::PAGE_TRANSITION_LINK); | 526 chrome::NavigateParams params(profile, url, ui::PAGE_TRANSITION_LINK); |
| 527 params.disposition = NEW_FOREGROUND_TAB; | 527 params.disposition = NEW_FOREGROUND_TAB; |
| 528 chrome::Navigate(¶ms); | 528 chrome::Navigate(¶ms); |
| 529 } | 529 } |
| 530 | 530 |
| 531 void ConsumerManagementService::NotifyStatusChanged() { | 531 void ConsumerManagementService::NotifyStatusChanged() { |
| 532 FOR_EACH_OBSERVER(Observer, observers_, OnConsumerManagementStatusChanged()); | 532 FOR_EACH_OBSERVER(Observer, observers_, OnConsumerManagementStatusChanged()); |
| 533 } | 533 } |
| 534 | 534 |
| 535 } // namespace policy | 535 } // namespace policy |
| OLD | NEW |