| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_screen_locker.h" | 5 #include "chrome/browser/chromeos/login/webui_screen_locker.h" |
| 6 | 6 |
| 7 #include <X11/extensions/XTest.h> | 7 #include <X11/extensions/XTest.h> |
| 8 #include <X11/keysym.h> | 8 #include <X11/keysym.h> |
| 9 #include <gdk/gdkkeysyms.h> | 9 #include <gdk/gdkkeysyms.h> |
| 10 #include <gdk/gdkx.h> | 10 #include <gdk/gdkx.h> |
| 11 | 11 |
| 12 // Evil hack to undo X11 evil #define. | 12 // Evil hack to undo X11 evil #define. |
| 13 #undef None | 13 #undef None |
| 14 #undef Status | 14 #undef Status |
| 15 | 15 |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "base/values.h" | 18 #include "base/values.h" |
| 19 #include "chrome/browser/chromeos/cros/cros_library.h" | 19 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 20 #include "chrome/browser/chromeos/cros/network_library.h" | 20 #include "chrome/browser/chromeos/cros/network_library.h" |
| 21 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" | 21 #include "chrome/browser/chromeos/legacy_window_manager/wm_ipc.h" |
| 22 #include "chrome/browser/chromeos/login/helper.h" | 22 #include "chrome/browser/chromeos/login/helper.h" |
| 23 #include "chrome/browser/chromeos/login/screen_locker.h" | 23 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 24 #include "chrome/browser/chromeos/login/user_manager.h" | 24 #include "chrome/browser/chromeos/login/user_manager.h" |
| 25 #include "chrome/browser/chromeos/login/webui_login_display.h" | 25 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 26 #include "chrome/browser/ui/views/dom_view.h" |
| 26 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 27 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 27 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
| 28 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 30 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 29 #include "content/public/browser/notification_service.h" | 31 #include "content/public/browser/notification_service.h" |
| 30 #include "content/public/browser/notification_types.h" | 32 #include "content/public/browser/notification_types.h" |
| 31 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
| 32 #include "ui/base/x/x11_util.h" | 34 #include "ui/base/x/x11_util.h" |
| 33 #include "ui/gfx/screen.h" | 35 #include "ui/gfx/screen.h" |
| 34 #include "views/widget/native_widget_gtk.h" | 36 #include "views/widget/native_widget_gtk.h" |
| 35 | 37 |
| 36 namespace { | 38 namespace { |
| 37 | 39 |
| 38 // URL which corresponds to the login WebUI. | 40 // URL which corresponds to the login WebUI. |
| 39 const char kLoginURL[] = "chrome://oobe/login"; | 41 const char kLoginURL[] = "chrome://oobe/login"; |
| 40 | 42 |
| 43 // The maximum duration for which locker should try to grab the keyboard and |
| 44 // mouse and its interval for regrabbing on failure. |
| 45 const int kMaxGrabFailureSec = 30; |
| 46 const int64 kRetryGrabIntervalMs = 500; |
| 47 |
| 48 // Maximum number of times we'll try to grab the keyboard and mouse before |
| 49 // giving up. If we hit the limit, Chrome exits and the session is terminated. |
| 50 const int kMaxGrabFailures = kMaxGrabFailureSec * 1000 / kRetryGrabIntervalMs; |
| 51 |
| 41 // A ScreenLock window that covers entire screen to keep the keyboard | 52 // A ScreenLock window that covers entire screen to keep the keyboard |
| 42 // focus/events inside the grab widget. | 53 // focus/events inside the grab widget. |
| 43 class LockWindow : public views::NativeWidgetGtk { | 54 class LockWindow : public views::NativeWidgetGtk { |
| 44 public: | 55 public: |
| 45 LockWindow() | 56 explicit LockWindow(chromeos::WebUIScreenLocker* webui_screen_locker) |
| 46 : views::NativeWidgetGtk(new views::Widget), | 57 : views::NativeWidgetGtk(new views::Widget), |
| 47 toplevel_focus_widget_(NULL) { | 58 toplevel_focus_widget_(NULL), |
| 59 webui_screen_locker_(webui_screen_locker) { |
| 48 EnableDoubleBuffer(true); | 60 EnableDoubleBuffer(true); |
| 49 } | 61 } |
| 50 | 62 |
| 51 // GTK propagates key events from parents to children. | |
| 52 // Make sure LockWindow will never handle key events. | |
| 53 virtual gboolean OnEventKey(GtkWidget* widget, GdkEventKey* event) OVERRIDE { | |
| 54 // Don't handle key event in the lock window. | |
| 55 return false; | |
| 56 } | |
| 57 | |
| 58 virtual gboolean OnButtonPress(GtkWidget* widget, | 63 virtual gboolean OnButtonPress(GtkWidget* widget, |
| 59 GdkEventButton* event) OVERRIDE { | 64 GdkEventButton* event) OVERRIDE { |
| 60 // Don't handle mouse event in the lock wnidow and | 65 // Never propagate mouse events to parent. |
| 61 // nor propagate to child. | |
| 62 return true; | 66 return true; |
| 63 } | 67 } |
| 64 | 68 |
| 65 virtual void OnDestroy(GtkWidget* object) OVERRIDE { | 69 virtual void OnDestroy(GtkWidget* object) OVERRIDE { |
| 66 VLOG(1) << "OnDestroy: LockWindow destroyed"; | 70 VLOG(1) << "OnDestroy: LockWindow destroyed"; |
| 67 views::NativeWidgetGtk::OnDestroy(object); | 71 views::NativeWidgetGtk::OnDestroy(object); |
| 68 } | 72 } |
| 69 | 73 |
| 70 virtual void ClearNativeFocus() OVERRIDE { | 74 virtual void ClearNativeFocus() OVERRIDE { |
| 71 DCHECK(toplevel_focus_widget_); | 75 DCHECK(toplevel_focus_widget_); |
| 72 gtk_widget_grab_focus(toplevel_focus_widget_); | 76 gtk_widget_grab_focus(toplevel_focus_widget_); |
| 73 } | 77 } |
| 74 | 78 |
| 79 virtual void HandleGtkGrabBroke() OVERRIDE { |
| 80 webui_screen_locker_->HandleGtkGrabBroke(); |
| 81 } |
| 82 |
| 75 // Sets the widget to move the focus to when clearning the native | 83 // Sets the widget to move the focus to when clearning the native |
| 76 // widget's focus. | 84 // widget's focus. |
| 77 void set_toplevel_focus_widget(GtkWidget* widget) { | 85 void set_toplevel_focus_widget(GtkWidget* widget) { |
| 78 gtk_widget_set_can_focus(widget, TRUE); | 86 gtk_widget_set_can_focus(widget, TRUE); |
| 79 toplevel_focus_widget_ = widget; | 87 toplevel_focus_widget_ = widget; |
| 80 } | 88 } |
| 81 | 89 |
| 82 private: | 90 private: |
| 83 // The widget we set focus to when clearning the focus on native | 91 // The widget we set focus to when clearning the focus on native |
| 84 // widget. In screen locker, gdk input is grabbed in GrabWidget, | 92 // widget. Gdk input is grabbed in WebUIScreenLocker, and resetting the focus |
| 85 // and resetting the focus by using gtk_window_set_focus seems to | 93 // by using gtk_window_set_focus seems to confuse gtk and doesn't let focus |
| 86 // confuse gtk and doesn't let focus move to native widget under | 94 // move to native widget under this. |
| 87 // GrabWidget. | |
| 88 GtkWidget* toplevel_focus_widget_; | 95 GtkWidget* toplevel_focus_widget_; |
| 89 | 96 |
| 97 // The WebUI screen locker. |
| 98 chromeos::WebUIScreenLocker* webui_screen_locker_; |
| 99 |
| 90 DISALLOW_COPY_AND_ASSIGN(LockWindow); | 100 DISALLOW_COPY_AND_ASSIGN(LockWindow); |
| 91 }; | 101 }; |
| 92 | 102 |
| 103 // Define separate methods for each error code so that stack trace |
| 104 // will tell which error the grab failed with. |
| 105 void FailedWithGrabAlreadyGrabbed() { |
| 106 LOG(FATAL) << "Grab already grabbed"; |
| 107 } |
| 108 void FailedWithGrabInvalidTime() { |
| 109 LOG(FATAL) << "Grab invalid time"; |
| 110 } |
| 111 void FailedWithGrabNotViewable() { |
| 112 LOG(FATAL) << "Grab not viewable"; |
| 113 } |
| 114 void FailedWithGrabFrozen() { |
| 115 LOG(FATAL) << "Grab frozen"; |
| 116 } |
| 117 void FailedWithUnknownError() { |
| 118 LOG(FATAL) << "Grab uknown"; |
| 119 } |
| 120 |
| 93 } // namespace | 121 } // namespace |
| 94 | 122 |
| 95 namespace chromeos { | 123 namespace chromeos { |
| 96 | 124 |
| 97 //////////////////////////////////////////////////////////////////////////////// | 125 //////////////////////////////////////////////////////////////////////////////// |
| 98 // WebUIScreenLocker implementation. | 126 // WebUIScreenLocker implementation. |
| 99 | 127 |
| 100 WebUIScreenLocker::WebUIScreenLocker(ScreenLocker* screen_locker) | 128 WebUIScreenLocker::WebUIScreenLocker(ScreenLocker* screen_locker) |
| 101 : ScreenLockerDelegate(screen_locker) { | 129 : ScreenLockerDelegate(screen_locker), |
| 130 drawn_(false), |
| 131 input_grabbed_(false), |
| 132 ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)), |
| 133 grab_failure_count_(0), |
| 134 kbd_grab_status_(GDK_GRAB_INVALID_TIME), |
| 135 mouse_grab_status_(GDK_GRAB_INVALID_TIME) { |
| 102 } | 136 } |
| 103 | 137 |
| 104 void WebUIScreenLocker::LockScreen(bool unlock_on_input) { | 138 void WebUIScreenLocker::LockScreen(bool unlock_on_input) { |
| 105 static const GdkColor kGdkBlack = {0, 0, 0, 0}; | 139 static const GdkColor kGdkBlack = {0, 0, 0, 0}; |
| 106 | 140 |
| 107 gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(NULL)); | 141 gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(NULL)); |
| 108 | 142 |
| 109 LockWindow* lock_window = new LockWindow(); | 143 LockWindow* lock_window = new LockWindow(this); |
| 110 lock_window_ = lock_window->GetWidget(); | 144 lock_window_ = lock_window->GetWidget(); |
| 111 views::Widget::InitParams params( | 145 views::Widget::InitParams params( |
| 112 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 146 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 113 params.bounds = bounds; | 147 params.bounds = bounds; |
| 114 params.native_widget = lock_window; | 148 params.native_widget = lock_window; |
| 115 lock_window_->Init(params); | 149 lock_window_->Init(params); |
| 116 gtk_widget_modify_bg( | 150 gtk_widget_modify_bg( |
| 117 lock_window_->GetNativeView(), GTK_STATE_NORMAL, &kGdkBlack); | 151 lock_window_->GetNativeView(), GTK_STATE_NORMAL, &kGdkBlack); |
| 118 | 152 |
| 119 g_signal_connect(lock_window_->GetNativeView(), "client-event", | 153 g_signal_connect(lock_window_->GetNativeView(), "client-event", |
| (...skipping 19 matching lines...) Expand all Loading... |
| 139 login_display_->set_parent_window( | 173 login_display_->set_parent_window( |
| 140 GTK_WINDOW(lock_window_->GetNativeView())); | 174 GTK_WINDOW(lock_window_->GetNativeView())); |
| 141 login_display_->Init(users, false, false); | 175 login_display_->Init(users, false, false); |
| 142 | 176 |
| 143 static_cast<OobeUI*>(GetWebUI())->ShowSigninScreen(login_display_.get()); | 177 static_cast<OobeUI*>(GetWebUI())->ShowSigninScreen(login_display_.get()); |
| 144 | 178 |
| 145 registrar_.Add(this, | 179 registrar_.Add(this, |
| 146 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, | 180 chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, |
| 147 content::NotificationService::AllSources()); | 181 content::NotificationService::AllSources()); |
| 148 | 182 |
| 183 ClearGtkGrab(); |
| 184 |
| 185 // Call this after lock_window_->Show(); otherwise the 1st invocation |
| 186 // of gdk_xxx_grab() will always fail. |
| 187 TryGrabAllInputs(); |
| 188 |
| 149 // Add the window to its own group so that its grab won't be stolen if | 189 // Add the window to its own group so that its grab won't be stolen if |
| 150 // gtk_grab_add() gets called on behalf on a non-screen-locker widget (e.g. | 190 // gtk_grab_add() gets called on behalf on a non-screen-locker widget (e.g. |
| 151 // a modal dialog) -- see http://crosbug.com/8999. We intentionally do this | 191 // a modal dialog) -- see http://crosbug.com/8999. We intentionally do this |
| 152 // after calling ClearGtkGrab(), as want to be in the default window group | 192 // after calling ClearGtkGrab(), as want to be in the default window group |
| 153 // then so we can break any existing GTK grabs. | 193 // then so we can break any existing GTK grabs. |
| 154 GtkWindowGroup* window_group = gtk_window_group_new(); | 194 GtkWindowGroup* window_group = gtk_window_group_new(); |
| 155 gtk_window_group_add_window(window_group, | 195 gtk_window_group_add_window(window_group, |
| 156 GTK_WINDOW(lock_window_->GetNativeView())); | 196 GTK_WINDOW(lock_window_->GetNativeView())); |
| 157 g_object_unref(window_group); | 197 g_object_unref(window_group); |
| 158 | 198 |
| 159 lock_window->set_toplevel_focus_widget(lock_window->window_contents()); | 199 lock_window->set_toplevel_focus_widget(lock_window->window_contents()); |
| 160 } | 200 } |
| 161 | 201 |
| 202 void WebUIScreenLocker::OnGrabInputs() { |
| 203 DVLOG(1) << "OnGrabInputs"; |
| 204 input_grabbed_ = true; |
| 205 if (drawn_) |
| 206 ScreenLockReady(); |
| 207 } |
| 208 |
| 209 void WebUIScreenLocker::OnWindowManagerReady() { |
| 210 DVLOG(1) << "OnClientEvent: drawn for lock"; |
| 211 drawn_ = true; |
| 212 if (input_grabbed_) |
| 213 ScreenLockReady(); |
| 214 } |
| 215 |
| 162 void WebUIScreenLocker::ScreenLockReady() { | 216 void WebUIScreenLocker::ScreenLockReady() { |
| 163 ScreenLockerDelegate::ScreenLockReady(); | 217 ScreenLockerDelegate::ScreenLockReady(); |
| 164 SetInputEnabled(true); | 218 SetInputEnabled(true); |
| 165 } | 219 } |
| 166 | 220 |
| 221 void WebUIScreenLocker::ClearGtkGrab() { |
| 222 GtkWidget* current_grab_window; |
| 223 // Grab gtk input first so that the menu holding gtk grab will |
| 224 // close itself. |
| 225 gtk_grab_add(webui_login_->native_view()); |
| 226 |
| 227 // Make sure there is no gtk grab widget so that gtk simply propagates |
| 228 // an event. GTK maintains grab widgets in a linked-list, so we need to |
| 229 // remove until it's empty. |
| 230 while ((current_grab_window = gtk_grab_get_current()) != NULL) |
| 231 gtk_grab_remove(current_grab_window); |
| 232 } |
| 233 |
| 234 void WebUIScreenLocker::TryGrabAllInputs() { |
| 235 // Grab on the RenderWidgetHostView hosting the WebUI login screen. |
| 236 GdkWindow* grab_widget = webui_login_->dom_contents()->tab_contents()-> |
| 237 GetRenderWidgetHostView()->GetNativeView()->window; |
| 238 // Grab x server so that we can atomically grab and take |
| 239 // action when grab fails. |
| 240 gdk_x11_grab_server(); |
| 241 gtk_grab_add(webui_login_->native_view()); |
| 242 if (kbd_grab_status_ != GDK_GRAB_SUCCESS) |
| 243 kbd_grab_status_ = gdk_keyboard_grab(grab_widget, FALSE, GDK_CURRENT_TIME); |
| 244 if (mouse_grab_status_ != GDK_GRAB_SUCCESS) { |
| 245 mouse_grab_status_ = |
| 246 gdk_pointer_grab(grab_widget, |
| 247 FALSE, |
| 248 static_cast<GdkEventMask>( |
| 249 GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | |
| 250 GDK_POINTER_MOTION_MASK), |
| 251 NULL, |
| 252 NULL, |
| 253 GDK_CURRENT_TIME); |
| 254 } |
| 255 if ((kbd_grab_status_ != GDK_GRAB_SUCCESS || |
| 256 mouse_grab_status_ != GDK_GRAB_SUCCESS) && |
| 257 grab_failure_count_++ < kMaxGrabFailures) { |
| 258 LOG(WARNING) << "Failed to grab inputs. Trying again in " |
| 259 << kRetryGrabIntervalMs << " ms: kbd=" |
| 260 << kbd_grab_status_ << ", mouse=" << mouse_grab_status_; |
| 261 TryUngrabOtherClients(); |
| 262 gdk_x11_ungrab_server(); |
| 263 MessageLoop::current()->PostDelayedTask( |
| 264 FROM_HERE, |
| 265 base::Bind(&WebUIScreenLocker::TryGrabAllInputs, |
| 266 weak_factory_.GetWeakPtr()), |
| 267 kRetryGrabIntervalMs); |
| 268 } else { |
| 269 gdk_x11_ungrab_server(); |
| 270 GdkGrabStatus status = kbd_grab_status_; |
| 271 if (status == GDK_GRAB_SUCCESS) { |
| 272 status = mouse_grab_status_; |
| 273 } |
| 274 switch (status) { |
| 275 case GDK_GRAB_SUCCESS: |
| 276 break; |
| 277 case GDK_GRAB_ALREADY_GRABBED: |
| 278 FailedWithGrabAlreadyGrabbed(); |
| 279 break; |
| 280 case GDK_GRAB_INVALID_TIME: |
| 281 FailedWithGrabInvalidTime(); |
| 282 break; |
| 283 case GDK_GRAB_NOT_VIEWABLE: |
| 284 FailedWithGrabNotViewable(); |
| 285 break; |
| 286 case GDK_GRAB_FROZEN: |
| 287 FailedWithGrabFrozen(); |
| 288 break; |
| 289 default: |
| 290 FailedWithUnknownError(); |
| 291 break; |
| 292 } |
| 293 DVLOG(1) << "Grab Success"; |
| 294 OnGrabInputs(); |
| 295 } |
| 296 } |
| 297 |
| 298 void WebUIScreenLocker::TryUngrabOtherClients() { |
| 299 #if !defined(NDEBUG) |
| 300 { |
| 301 int event_base, error_base; |
| 302 int major, minor; |
| 303 // Make sure we have XTest extension. |
| 304 DCHECK(XTestQueryExtension(ui::GetXDisplay(), |
| 305 &event_base, &error_base, |
| 306 &major, &minor)); |
| 307 } |
| 308 #endif |
| 309 |
| 310 // The following code is an attempt to grab inputs by closing |
| 311 // supposedly opened menu. This happens when a plugin has a menu |
| 312 // opened. |
| 313 if (mouse_grab_status_ == GDK_GRAB_ALREADY_GRABBED || |
| 314 mouse_grab_status_ == GDK_GRAB_FROZEN) { |
| 315 // Successfully grabbed the keyboard, but pointer is still |
| 316 // grabbed by other client. Another attempt to close supposedly |
| 317 // opened menu by emulating keypress at the left top corner. |
| 318 Display* display = ui::GetXDisplay(); |
| 319 Window root, child; |
| 320 int root_x, root_y, win_x, winy; |
| 321 unsigned int mask; |
| 322 XQueryPointer(display, |
| 323 ui::GetX11WindowFromGtkWidget( |
| 324 static_cast<LockWindow*>(lock_window_->native_widget())-> |
| 325 window_contents()), |
| 326 &root, &child, &root_x, &root_y, |
| 327 &win_x, &winy, &mask); |
| 328 XTestFakeMotionEvent(display, -1, -10000, -10000, CurrentTime); |
| 329 XTestFakeButtonEvent(display, 1, True, CurrentTime); |
| 330 XTestFakeButtonEvent(display, 1, False, CurrentTime); |
| 331 // Move the pointer back. |
| 332 XTestFakeMotionEvent(display, -1, root_x, root_y, CurrentTime); |
| 333 XFlush(display); |
| 334 } else if (kbd_grab_status_ == GDK_GRAB_ALREADY_GRABBED || |
| 335 kbd_grab_status_ == GDK_GRAB_FROZEN) { |
| 336 // Successfully grabbed the pointer, but keyboard is still grabbed |
| 337 // by other client. Another attempt to close supposedly opened |
| 338 // menu by emulating escape key. Such situation must be very |
| 339 // rare, but handling this just in case |
| 340 Display* display = ui::GetXDisplay(); |
| 341 KeyCode escape = XKeysymToKeycode(display, XK_Escape); |
| 342 XTestFakeKeyEvent(display, escape, True, CurrentTime); |
| 343 XTestFakeKeyEvent(display, escape, False, CurrentTime); |
| 344 XFlush(display); |
| 345 } |
| 346 } |
| 347 |
| 348 void WebUIScreenLocker::HandleGtkGrabBroke() { |
| 349 // Input should never be stolen from ScreenLocker once it's |
| 350 // grabbed. If this happens, it's a bug and has to be fixed. We |
| 351 // let chrome crash to get a crash report and dump, and |
| 352 // SessionManager will terminate the session to logout. |
| 353 CHECK_NE(GDK_GRAB_SUCCESS, kbd_grab_status_); |
| 354 CHECK_NE(GDK_GRAB_SUCCESS, mouse_grab_status_); |
| 355 } |
| 356 |
| 167 void WebUIScreenLocker::OnAuthenticate() { | 357 void WebUIScreenLocker::OnAuthenticate() { |
| 168 } | 358 } |
| 169 | 359 |
| 170 void WebUIScreenLocker::SetInputEnabled(bool enabled) { | 360 void WebUIScreenLocker::SetInputEnabled(bool enabled) { |
| 171 login_display_->SetUIEnabled(enabled); | 361 login_display_->SetUIEnabled(enabled); |
| 172 SetStatusAreaEnabled(enabled); | 362 SetStatusAreaEnabled(enabled); |
| 173 } | 363 } |
| 174 | 364 |
| 175 void WebUIScreenLocker::SetSignoutEnabled(bool enabled) { | 365 void WebUIScreenLocker::SetSignoutEnabled(bool enabled) { |
| 176 // TODO(flackr): Implement. | 366 // TODO(flackr): Implement. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 203 | 393 |
| 204 WebUIScreenLocker::~WebUIScreenLocker() { | 394 WebUIScreenLocker::~WebUIScreenLocker() { |
| 205 DCHECK(lock_window_); | 395 DCHECK(lock_window_); |
| 206 lock_window_->Close(); | 396 lock_window_->Close(); |
| 207 } | 397 } |
| 208 | 398 |
| 209 void WebUIScreenLocker::OnClientEvent(GtkWidget* widge, GdkEventClient* event) { | 399 void WebUIScreenLocker::OnClientEvent(GtkWidget* widge, GdkEventClient* event) { |
| 210 WmIpc::Message msg; | 400 WmIpc::Message msg; |
| 211 WmIpc::instance()->DecodeMessage(*event, &msg); | 401 WmIpc::instance()->DecodeMessage(*event, &msg); |
| 212 if (msg.type() == WM_IPC_MESSAGE_CHROME_NOTIFY_SCREEN_REDRAWN_FOR_LOCK) | 402 if (msg.type() == WM_IPC_MESSAGE_CHROME_NOTIFY_SCREEN_REDRAWN_FOR_LOCK) |
| 213 ScreenLockReady(); | 403 OnWindowManagerReady(); |
| 214 } | 404 } |
| 215 | 405 |
| 216 //////////////////////////////////////////////////////////////////////////////// | 406 //////////////////////////////////////////////////////////////////////////////// |
| 217 // WebUIScreenLocker, content::NotificationObserver implementation: | 407 // WebUIScreenLocker, content::NotificationObserver implementation: |
| 218 | 408 |
| 219 void WebUIScreenLocker::Observe( | 409 void WebUIScreenLocker::Observe( |
| 220 int type, | 410 int type, |
| 221 const content::NotificationSource& source, | 411 const content::NotificationSource& source, |
| 222 const content::NotificationDetails& details) { | 412 const content::NotificationDetails& details) { |
| 223 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED) | 413 if (type != chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 } | 450 } |
| 261 | 451 |
| 262 void WebUIScreenLocker::OnUserSelected(const std::string& username) { | 452 void WebUIScreenLocker::OnUserSelected(const std::string& username) { |
| 263 } | 453 } |
| 264 | 454 |
| 265 void WebUIScreenLocker::OnStartEnterpriseEnrollment() { | 455 void WebUIScreenLocker::OnStartEnterpriseEnrollment() { |
| 266 NOTREACHED(); | 456 NOTREACHED(); |
| 267 } | 457 } |
| 268 | 458 |
| 269 } // namespace chromeos | 459 } // namespace chromeos |
| OLD | NEW |