| 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/app_mode/kiosk_mode_idle_app_name_notification
.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification
.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | |
| 8 #include "base/bind.h" | 7 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 9 #include "base/logging.h" |
| 11 #include "chrome/browser/chromeos/ui/idle_app_name_notification_view.h" | 10 #include "chrome/browser/chromeos/ui/idle_app_name_notification_view.h" |
| 12 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "chrome/common/chrome_switches.h" | 13 #include "chrome/common/chrome_switches.h" |
| 15 #include "chromeos/dbus/dbus_thread_manager.h" | 14 #include "chromeos/dbus/dbus_thread_manager.h" |
| 16 #include "components/user_manager/user_manager.h" | 15 #include "components/user_manager/user_manager.h" |
| 17 #include "extensions/browser/extension_system.h" | 16 #include "extensions/browser/extension_system.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 69 } |
| 71 } | 70 } |
| 72 | 71 |
| 73 void KioskModeIdleAppNameNotification::Setup() { | 72 void KioskModeIdleAppNameNotification::Setup() { |
| 74 DCHECK(user_manager::UserManager::Get()->IsUserLoggedIn()); | 73 DCHECK(user_manager::UserManager::Get()->IsUserLoggedIn()); |
| 75 Start(); | 74 Start(); |
| 76 } | 75 } |
| 77 | 76 |
| 78 void KioskModeIdleAppNameNotification::OnUserActivity(const ui::Event* event) { | 77 void KioskModeIdleAppNameNotification::OnUserActivity(const ui::Event* event) { |
| 79 if (show_notification_upon_next_user_activity_) { | 78 if (show_notification_upon_next_user_activity_) { |
| 80 gfx::Display display = ash::Shell::GetScreen()->GetPrimaryDisplay(); | 79 gfx::Display display = gfx::Screen::GetScreen()->GetPrimaryDisplay(); |
| 81 // Display the notification only on internal display. | 80 // Display the notification only on internal display. |
| 82 if (display.IsInternal()) { | 81 if (display.IsInternal()) { |
| 83 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 82 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 84 const std::string app_id = | 83 const std::string app_id = |
| 85 command_line->GetSwitchValueASCII(::switches::kAppId); | 84 command_line->GetSwitchValueASCII(::switches::kAppId); |
| 86 Profile* profile = ProfileManager::GetActiveUserProfile(); | 85 Profile* profile = ProfileManager::GetActiveUserProfile(); |
| 87 notification_.reset( | 86 notification_.reset( |
| 88 new IdleAppNameNotificationView( | 87 new IdleAppNameNotificationView( |
| 89 kMessageVisibilityTimeMs, | 88 kMessageVisibilityTimeMs, |
| 90 kMessageAnimationTimeMs, | 89 kMessageAnimationTimeMs, |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 base::Bind(&KioskModeIdleAppNameNotification::OnTimeout, | 124 base::Bind(&KioskModeIdleAppNameNotification::OnTimeout, |
| 126 base::Unretained(this))); | 125 base::Unretained(this))); |
| 127 } | 126 } |
| 128 } | 127 } |
| 129 | 128 |
| 130 void KioskModeIdleAppNameNotification::OnTimeout() { | 129 void KioskModeIdleAppNameNotification::OnTimeout() { |
| 131 show_notification_upon_next_user_activity_ = true; | 130 show_notification_upon_next_user_activity_ = true; |
| 132 } | 131 } |
| 133 | 132 |
| 134 } // namespace chromeos | 133 } // namespace chromeos |
| OLD | NEW |