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

Side by Side Diff: chrome/browser/chromeos/ui/idle_logout_dialog_view.cc

Issue 10031050: Make idle logout window not cause the app list to disappear. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/idle_logout_dialog_view.h" 5 #include "chrome/browser/chromeos/ui/idle_logout_dialog_view.h"
6 6
7 #include "ash/shell.h"
7 #include "base/bind.h" 8 #include "base/bind.h"
8 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
9 #include "base/time.h" 10 #include "base/time.h"
10 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
11 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" 12 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
12 #include "chrome/browser/ui/browser_list.h" 13 #include "chrome/browser/ui/browser_list.h"
13 #include "grit/browser_resources.h" 14 #include "grit/browser_resources.h"
14 #include "grit/generated_resources.h" 15 #include "grit/generated_resources.h"
15 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
16 #include "ui/base/resource/resource_bundle.h" 17 #include "ui/base/resource/resource_bundle.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 void IdleLogoutDialogView::Show() { 164 void IdleLogoutDialogView::Show() {
164 KioskModeSettings* settings = 165 KioskModeSettings* settings =
165 IdleLogoutDialogView::provider_->GetKioskModeSettings(); 166 IdleLogoutDialogView::provider_->GetKioskModeSettings();
166 167
167 // Setup the countdown label before showing. 168 // Setup the countdown label before showing.
168 countdown_end_time_ = base::Time::Now() + 169 countdown_end_time_ = base::Time::Now() +
169 settings->GetIdleLogoutWarningDuration(); 170 settings->GetIdleLogoutWarningDuration();
170 171
171 UpdateCountdown(); 172 UpdateCountdown();
172 173
173 views::Widget::CreateWindow(this); 174 // If the apps list is displayed, we should show as it's child. Not doing
174 GetWidget()->SetAlwaysOnTop(true); 175 // so will cause the apps list to disappear.
176 gfx::NativeWindow app_list = ash::Shell::GetInstance()->GetAppListWindow();
177 if (app_list) {
178 views::Widget::CreateWindowWithParent(this, app_list);
179 } else {
180 views::Widget::CreateWindow(this);
181 GetWidget()->SetAlwaysOnTop(true);
182 }
175 GetWidget()->Show(); 183 GetWidget()->Show();
176 184
177 // Update countdown every 1 second. 185 // Update countdown every 1 second.
178 timer_.Start(FROM_HERE, 186 timer_.Start(FROM_HERE,
179 IdleLogoutDialogView::provider_->GetCountdownUpdateInterval(), 187 IdleLogoutDialogView::provider_->GetCountdownUpdateInterval(),
180 this, 188 this,
181 &IdleLogoutDialogView::UpdateCountdown); 189 &IdleLogoutDialogView::UpdateCountdown);
182 } 190 }
183 191
184 void IdleLogoutDialogView::Close() { 192 void IdleLogoutDialogView::Close() {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 return g_instance; 226 return g_instance;
219 } 227 }
220 228
221 // static 229 // static
222 void IdleLogoutDialogView::set_settings_provider( 230 void IdleLogoutDialogView::set_settings_provider(
223 IdleLogoutSettingsProvider* provider) { 231 IdleLogoutSettingsProvider* provider) {
224 provider_ = provider; 232 provider_ = provider;
225 } 233 }
226 234
227 } // namespace chromeos 235 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698