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

Side by Side Diff: chrome/browser/chromeos/app_mode/kiosk_mode_idle_app_name_notification.cc

Issue 240343004: chromeos: Update IdleActionImminent and SuspendDone handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 8 months 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 | Annotate | Revision Log
OLDNEW
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" 7 #include "ash/shell.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 new IdleAppNameNotificationView( 82 new IdleAppNameNotificationView(
83 kMessageVisibilityTimeMs, 83 kMessageVisibilityTimeMs,
84 kMessageAnimationTimeMs, 84 kMessageAnimationTimeMs,
85 extensions::ExtensionSystem::Get(profile 85 extensions::ExtensionSystem::Get(profile
86 )->extension_service()->GetInstalledExtension(app_id))); 86 )->extension_service()->GetInstalledExtension(app_id)));
87 show_notification_upon_next_user_activity_ = false; 87 show_notification_upon_next_user_activity_ = false;
88 } 88 }
89 ResetTimer(); 89 ResetTimer();
90 } 90 }
91 91
92 void KioskModeIdleAppNameNotification::SystemResumed( 92 void KioskModeIdleAppNameNotification::SuspendDone(
93 const base::TimeDelta& sleep_duration) { 93 const base::TimeDelta& sleep_duration) {
94 // When we come back from a system resume we stop the timer and show the 94 // When we come back from a system resume we stop the timer and show the
95 // message. 95 // message.
96 timer_.Stop(); 96 timer_.Stop();
97 OnTimeout(); 97 OnTimeout();
98 } 98 }
99 99
100 void KioskModeIdleAppNameNotification::Start() { 100 void KioskModeIdleAppNameNotification::Start() {
101 if (!ash::Shell::GetInstance()->user_activity_detector()->HasObserver(this)) { 101 if (!ash::Shell::GetInstance()->user_activity_detector()->HasObserver(this)) {
102 ash::Shell::GetInstance()->user_activity_detector()->AddObserver(this); 102 ash::Shell::GetInstance()->user_activity_detector()->AddObserver(this);
(...skipping 15 matching lines...) Expand all
118 base::Bind(&KioskModeIdleAppNameNotification::OnTimeout, 118 base::Bind(&KioskModeIdleAppNameNotification::OnTimeout,
119 base::Unretained(this))); 119 base::Unretained(this)));
120 } 120 }
121 } 121 }
122 122
123 void KioskModeIdleAppNameNotification::OnTimeout() { 123 void KioskModeIdleAppNameNotification::OnTimeout() {
124 show_notification_upon_next_user_activity_ = true; 124 show_notification_upon_next_user_activity_ = true;
125 } 125 }
126 126
127 } // namespace chromeos 127 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698