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 20 matching lines...) Expand all Loading... |
31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
32 #include "chromeos/dbus/cryptohome/rpc.pb.h" | 32 #include "chromeos/dbus/cryptohome/rpc.pb.h" |
33 #include "chromeos/dbus/cryptohome_client.h" | 33 #include "chromeos/dbus/cryptohome_client.h" |
34 #include "components/policy/core/common/cloud/cloud_policy_constants.h" | 34 #include "components/policy/core/common/cloud/cloud_policy_constants.h" |
35 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 35 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
36 #include "components/signin/core/browser/signin_manager_base.h" | 36 #include "components/signin/core/browser/signin_manager_base.h" |
37 #include "components/user_manager/user_manager.h" | 37 #include "components/user_manager/user_manager.h" |
38 #include "content/public/browser/notification_details.h" | 38 #include "content/public/browser/notification_details.h" |
39 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
40 #include "content/public/browser/notification_source.h" | 40 #include "content/public/browser/notification_source.h" |
41 #include "content/public/common/page_transition_types.h" | |
42 #include "google_apis/gaia/gaia_constants.h" | 41 #include "google_apis/gaia/gaia_constants.h" |
43 #include "google_apis/gaia/google_service_auth_error.h" | 42 #include "google_apis/gaia/google_service_auth_error.h" |
44 #include "grit/generated_resources.h" | 43 #include "grit/generated_resources.h" |
45 #include "grit/theme_resources.h" | 44 #include "grit/theme_resources.h" |
46 #include "policy/proto/device_management_backend.pb.h" | 45 #include "policy/proto/device_management_backend.pb.h" |
47 #include "third_party/WebKit/public/web/WebTextDirection.h" | 46 #include "third_party/WebKit/public/web/WebTextDirection.h" |
48 #include "ui/base/l10n/l10n_util.h" | 47 #include "ui/base/l10n/l10n_util.h" |
| 48 #include "ui/base/page_transition_types.h" |
49 #include "ui/base/resource/resource_bundle.h" | 49 #include "ui/base/resource/resource_bundle.h" |
50 #include "ui/base/window_open_disposition.h" | 50 #include "ui/base/window_open_disposition.h" |
51 #include "ui/message_center/notification.h" | 51 #include "ui/message_center/notification.h" |
52 #include "ui/message_center/notification_types.h" | 52 #include "ui/message_center/notification_types.h" |
53 #include "ui/message_center/notifier_settings.h" | 53 #include "ui/message_center/notifier_settings.h" |
54 #include "url/gurl.h" | 54 #include "url/gurl.h" |
55 | 55 |
56 namespace { | 56 namespace { |
57 | 57 |
58 // Boot atttributes ID. | 58 // Boot atttributes ID. |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 new DesktopNotificationDelegate(kEnrollmentNotificationId, | 507 new DesktopNotificationDelegate(kEnrollmentNotificationId, |
508 button_click_callback)); | 508 button_click_callback)); |
509 notification.SetSystemPriority(); | 509 notification.SetSystemPriority(); |
510 g_browser_process->notification_ui_manager()->Add(notification, profile); | 510 g_browser_process->notification_ui_manager()->Add(notification, profile); |
511 | 511 |
512 SetEnrollmentStage(ENROLLMENT_STAGE_NONE); | 512 SetEnrollmentStage(ENROLLMENT_STAGE_NONE); |
513 } | 513 } |
514 | 514 |
515 void ConsumerManagementService::OpenSettingsPage(Profile* profile) const { | 515 void ConsumerManagementService::OpenSettingsPage(Profile* profile) const { |
516 const GURL url(chrome::kChromeUISettingsURL); | 516 const GURL url(chrome::kChromeUISettingsURL); |
517 chrome::NavigateParams params(profile, url, content::PAGE_TRANSITION_LINK); | 517 chrome::NavigateParams params(profile, url, ui::PAGE_TRANSITION_LINK); |
518 params.disposition = NEW_FOREGROUND_TAB; | 518 params.disposition = NEW_FOREGROUND_TAB; |
519 chrome::Navigate(¶ms); | 519 chrome::Navigate(¶ms); |
520 } | 520 } |
521 | 521 |
522 void ConsumerManagementService::TryEnrollmentAgain(Profile* profile) const { | 522 void ConsumerManagementService::TryEnrollmentAgain(Profile* profile) const { |
523 const GURL base_url(chrome::kChromeUISettingsURL); | 523 const GURL base_url(chrome::kChromeUISettingsURL); |
524 const GURL url = base_url.Resolve(kConsumerManagementOverlay); | 524 const GURL url = base_url.Resolve(kConsumerManagementOverlay); |
525 | 525 |
526 chrome::NavigateParams params(profile, url, content::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 |