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

Side by Side Diff: chrome/browser/chromeos/login/webui_login_display_host.cc

Issue 9181012: Don't activate a window if screen is locked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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 (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/login/webui_login_display_host.h" 5 #include "chrome/browser/chromeos/login/webui_login_display_host.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "chrome/browser/chromeos/login/oobe_display.h" 9 #include "chrome/browser/chromeos/login/oobe_display.h"
10 #include "chrome/browser/chromeos/login/webui_login_display.h" 10 #include "chrome/browser/chromeos/login/webui_login_display.h"
11 #include "chrome/browser/chromeos/login/webui_login_view.h" 11 #include "chrome/browser/chromeos/login/webui_login_view.h"
12 #include "chrome/browser/chromeos/login/wizard_controller.h" 12 #include "chrome/browser/chromeos/login/wizard_controller.h"
13 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" 13 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
14 #include "ui/views/widget/widget.h" 14 #include "ui/views/widget/widget.h"
15 15
16 #if defined(USE_AURA) 16 #if defined(USE_AURA)
17 #include "ash/shell.h" 17 #include "ash/shell.h"
18 #include "ash/shell_window_ids.h"
19 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
20 #endif 19 #endif
21 20
22 namespace chromeos { 21 namespace chromeos {
23 22
24 namespace { 23 namespace {
25 24
26 // URL which corresponds to the login WebUI. 25 // URL which corresponds to the login WebUI.
27 const char kLoginURL[] = "chrome://oobe/login"; 26 const char kLoginURL[] = "chrome://oobe/login";
28 // URL which corresponds to the OOBE WebUI. 27 // URL which corresponds to the OOBE WebUI.
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 123 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
125 params.bounds = background_bounds(); 124 params.bounds = background_bounds();
126 125
127 login_window_ = new views::Widget; 126 login_window_ = new views::Widget;
128 login_window_->Init(params); 127 login_window_->Init(params);
129 login_view_ = new WebUILoginView(); 128 login_view_ = new WebUILoginView();
130 129
131 login_view_->Init(login_window_); 130 login_view_->Init(login_window_);
132 131
133 #if defined(USE_AURA) 132 #if defined(USE_AURA)
134 ash::Shell::GetInstance()->GetContainer( 133 login_window_->GetNativeView()->set_stops_event_propagation(true);
135 ash::internal::kShellWindowId_LockScreenContainer)-> 134 // Let the shell pick the container.
136 AddChild(login_window_->GetNativeView()); 135 login_window_->GetNativeView()->SetParent(NULL);
137 #endif 136 #endif
138 137
139 login_window_->SetContentsView(login_view_); 138 login_window_->SetContentsView(login_view_);
140 login_view_->UpdateWindowType(); 139 login_view_->UpdateWindowType();
141 140
142 login_window_->Show(); 141 login_window_->Show();
143 #if defined(USE_AURA) 142 #if defined(USE_AURA)
144 login_window_->GetNativeView()->SetName("WebUILoginView"); 143 login_window_->GetNativeView()->SetName("WebUILoginView");
145 #endif 144 #endif
146 login_view_->OnWindowCreated(); 145 login_view_->OnWindowCreated();
147 } 146 }
148 login_view_->LoadURL(url); 147 login_view_->LoadURL(url);
149 } 148 }
150 149
151 OobeUI* WebUILoginDisplayHost::GetOobeUI() const { 150 OobeUI* WebUILoginDisplayHost::GetOobeUI() const {
152 return static_cast<OobeUI*>(login_view_->GetWebUI()); 151 return static_cast<OobeUI*>(login_view_->GetWebUI());
153 } 152 }
154 153
155 WizardController* WebUILoginDisplayHost::CreateWizardController() { 154 WizardController* WebUILoginDisplayHost::CreateWizardController() {
156 // TODO(altimofeev): ensure that WebUI is ready. 155 // TODO(altimofeev): ensure that WebUI is ready.
157 OobeDisplay* oobe_display = GetOobeUI(); 156 OobeDisplay* oobe_display = GetOobeUI();
158 return new WizardController(this, oobe_display); 157 return new WizardController(this, oobe_display);
159 } 158 }
160 159
161 } // namespace chromeos 160 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698