| 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/screen_locker_views.h" | 5 #include "chrome/browser/chromeos/login/screen_locker_views.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 "chrome/browser/chromeos/login/background_view.h" | 18 #include "chrome/browser/chromeos/login/background_view.h" |
| 19 #include "chrome/browser/chromeos/login/login_performer.h" | 19 #include "chrome/browser/chromeos/login/login_performer.h" |
| 20 #include "chrome/browser/chromeos/login/message_bubble.h" | 20 #include "chrome/browser/chromeos/login/message_bubble.h" |
| 21 #include "chrome/browser/chromeos/login/screen_lock_view.h" | 21 #include "chrome/browser/chromeos/login/screen_lock_view.h" |
| 22 #include "chrome/browser/chromeos/login/screen_locker.h" | 22 #include "chrome/browser/chromeos/login/screen_locker.h" |
| 23 #include "chrome/browser/chromeos/login/shutdown_button.h" | 23 #include "chrome/browser/chromeos/login/shutdown_button.h" |
| 24 #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" |
| 24 #include "chrome/browser/chromeos/view_ids.h" | 25 #include "chrome/browser/chromeos/view_ids.h" |
| 25 #include "chrome/browser/prefs/pref_service.h" | 26 #include "chrome/browser/prefs/pref_service.h" |
| 26 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
| 28 #include "content/browser/user_metrics.h" | 29 #include "content/browser/user_metrics.h" |
| 29 #include "grit/theme_resources.h" | 30 #include "grit/theme_resources.h" |
| 30 #include "ui/base/resource/resource_bundle.h" | 31 #include "ui/base/resource/resource_bundle.h" |
| 31 #include "ui/base/x/x11_util.h" | 32 #include "ui/base/x/x11_util.h" |
| 32 #include "ui/gfx/screen.h" | 33 #include "ui/gfx/screen.h" |
| 33 | 34 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 // BackgroundView for ScreenLocker, which layouts a lock widget in | 382 // BackgroundView for ScreenLocker, which layouts a lock widget in |
| 382 // addition to other background components. | 383 // addition to other background components. |
| 383 class ScreenLockerBackgroundView | 384 class ScreenLockerBackgroundView |
| 384 : public chromeos::BackgroundView, | 385 : public chromeos::BackgroundView, |
| 385 public chromeos::ScreenLockerViews::ScreenLockViewContainer { | 386 public chromeos::ScreenLockerViews::ScreenLockViewContainer { |
| 386 public: | 387 public: |
| 387 ScreenLockerBackgroundView(views::Widget* lock_widget, | 388 ScreenLockerBackgroundView(views::Widget* lock_widget, |
| 388 views::View* screen_lock_view) | 389 views::View* screen_lock_view) |
| 389 : lock_widget_(lock_widget), | 390 : lock_widget_(lock_widget), |
| 390 screen_lock_view_(screen_lock_view) { | 391 screen_lock_view_(screen_lock_view) { |
| 391 } | 392 set_screen_mode(chromeos::StatusAreaViewChromeos::SCREEN_LOCKER_MODE); |
| 392 | |
| 393 virtual ScreenMode GetScreenMode() const OVERRIDE { | |
| 394 return kScreenLockerMode; | |
| 395 } | 393 } |
| 396 | 394 |
| 397 virtual void Layout() OVERRIDE { | 395 virtual void Layout() OVERRIDE { |
| 398 chromeos::BackgroundView::Layout(); | 396 chromeos::BackgroundView::Layout(); |
| 399 gfx::Rect screen = bounds(); | 397 gfx::Rect screen = bounds(); |
| 400 if (screen_lock_view_) { | 398 if (screen_lock_view_) { |
| 401 gfx::Size size = screen_lock_view_->GetPreferredSize(); | 399 gfx::Size size = screen_lock_view_->GetPreferredSize(); |
| 402 gfx::Point origin((screen.width() - size.width()) / 2, | 400 gfx::Point origin((screen.width() - size.width()) / 2, |
| 403 (screen.height() - size.height()) / 2); | 401 (screen.height() - size.height()) / 2); |
| 404 gfx::Size widget_size(screen.size()); | 402 gfx::Size widget_size(screen.size()); |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 #if defined(TOOLKIT_USES_GTK) | 925 #if defined(TOOLKIT_USES_GTK) |
| 928 WmIpc::Message msg; | 926 WmIpc::Message msg; |
| 929 WmIpc::instance()->DecodeMessage(*event, &msg); | 927 WmIpc::instance()->DecodeMessage(*event, &msg); |
| 930 if (msg.type() == WM_IPC_MESSAGE_CHROME_NOTIFY_SCREEN_REDRAWN_FOR_LOCK) { | 928 if (msg.type() == WM_IPC_MESSAGE_CHROME_NOTIFY_SCREEN_REDRAWN_FOR_LOCK) { |
| 931 OnWindowManagerReady(); | 929 OnWindowManagerReady(); |
| 932 } | 930 } |
| 933 #endif | 931 #endif |
| 934 } | 932 } |
| 935 | 933 |
| 936 } // namespace chromeos | 934 } // namespace chromeos |
| OLD | NEW |