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> |
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
789 const string16& message) { | 789 const string16& message) { |
790 postponed_error_message_ = message; | 790 postponed_error_message_ = message; |
791 if (captcha_view_) { | 791 if (captcha_view_) { |
792 captcha_view_->SetCaptchaURL(captcha_url); | 792 captcha_view_->SetCaptchaURL(captcha_url); |
793 } else { | 793 } else { |
794 captcha_view_ = new CaptchaView(captcha_url, true); | 794 captcha_view_ = new CaptchaView(captcha_url, true); |
795 captcha_view_->Init(); | 795 captcha_view_->Init(); |
796 captcha_view_->set_delegate(this); | 796 captcha_view_->set_delegate(this); |
797 } | 797 } |
798 // CaptchaView ownership is passed to grab_container_. | 798 // CaptchaView ownership is passed to grab_container_. |
799 views::View* view = secondary_view_.release(); | 799 ignore_result(secondary_view_.release()); |
800 view = NULL; | |
801 screen_lock_view_->SetVisible(false); | 800 screen_lock_view_->SetVisible(false); |
802 grab_container_->SetScreenLockView(captcha_view_); | 801 grab_container_->SetScreenLockView(captcha_view_); |
803 background_container_->SetScreenLockView(captcha_view_); | 802 background_container_->SetScreenLockView(captcha_view_); |
804 captcha_view_->SetVisible(true); | 803 captcha_view_->SetVisible(true); |
805 // Take ScreenLockView ownership now that it's removed from grab_container_. | 804 // Take ScreenLockView ownership now that it's removed from grab_container_. |
806 secondary_view_.reset(screen_lock_view_); | 805 secondary_view_.reset(screen_lock_view_); |
807 } | 806 } |
808 | 807 |
809 void ScreenLockerViews::ClearErrors() { | 808 void ScreenLockerViews::ClearErrors() { |
810 if (error_info_) { | 809 if (error_info_) { |
(...skipping 24 matching lines...) Expand all Loading... |
835 | 834 |
836 void ScreenLockerViews::OnCaptchaEntered(const std::string& captcha) { | 835 void ScreenLockerViews::OnCaptchaEntered(const std::string& captcha) { |
837 // Captcha dialog is only shown when LoginPerformer instance exists, | 836 // Captcha dialog is only shown when LoginPerformer instance exists, |
838 // i.e. blocking UI after password change is in place. | 837 // i.e. blocking UI after password change is in place. |
839 DCHECK(LoginPerformer::default_performer()); | 838 DCHECK(LoginPerformer::default_performer()); |
840 LoginPerformer::default_performer()->set_captcha(captcha); | 839 LoginPerformer::default_performer()->set_captcha(captcha); |
841 | 840 |
842 // ScreenLockView ownership is passed to grab_container_. | 841 // ScreenLockView ownership is passed to grab_container_. |
843 // Need to save return value here so that compile | 842 // Need to save return value here so that compile |
844 // doesn't fail with "unused result" warning. | 843 // doesn't fail with "unused result" warning. |
845 views::View* view = secondary_view_.release(); | 844 ignore_result(secondary_view_.release()); |
846 view = NULL; | |
847 captcha_view_->SetVisible(false); | 845 captcha_view_->SetVisible(false); |
848 grab_container_->SetScreenLockView(screen_lock_view_); | 846 grab_container_->SetScreenLockView(screen_lock_view_); |
849 background_container_->SetScreenLockView(screen_lock_view_); | 847 background_container_->SetScreenLockView(screen_lock_view_); |
850 screen_lock_view_->SetVisible(true); | 848 screen_lock_view_->SetVisible(true); |
851 screen_lock_view_->ClearAndSetFocusToPassword(); | 849 screen_lock_view_->ClearAndSetFocusToPassword(); |
852 | 850 |
853 // Take CaptchaView ownership now that it's removed from grab_container_. | 851 // Take CaptchaView ownership now that it's removed from grab_container_. |
854 secondary_view_.reset(captcha_view_); | 852 secondary_view_.reset(captcha_view_); |
855 ShowErrorMessage(postponed_error_message_, false); | 853 ShowErrorMessage(postponed_error_message_, false); |
856 postponed_error_message_.clear(); | 854 postponed_error_message_.clear(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
925 #if defined(TOOLKIT_USES_GTK) | 923 #if defined(TOOLKIT_USES_GTK) |
926 WmIpc::Message msg; | 924 WmIpc::Message msg; |
927 WmIpc::instance()->DecodeMessage(*event, &msg); | 925 WmIpc::instance()->DecodeMessage(*event, &msg); |
928 if (msg.type() == WM_IPC_MESSAGE_CHROME_NOTIFY_SCREEN_REDRAWN_FOR_LOCK) { | 926 if (msg.type() == WM_IPC_MESSAGE_CHROME_NOTIFY_SCREEN_REDRAWN_FOR_LOCK) { |
929 OnWindowManagerReady(); | 927 OnWindowManagerReady(); |
930 } | 928 } |
931 #endif | 929 #endif |
932 } | 930 } |
933 | 931 |
934 } // namespace chromeos | 932 } // namespace chromeos |
OLD | NEW |