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

Side by Side Diff: chrome/browser/chromeos/login/lock/webui_screen_locker.cc

Issue 371923002: cros: Fixes the text input focus when screen is locked. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/lock/webui_screen_locker.h" 5 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/wm/lock_state_controller.h" 8 #include "ash/wm/lock_state_controller.h"
9 #include "ash/wm/lock_state_observer.h" 9 #include "ash/wm/lock_state_observer.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 13 matching lines...) Expand all
24 #include "chrome/common/url_constants.h" 24 #include "chrome/common/url_constants.h"
25 #include "chromeos/dbus/dbus_thread_manager.h" 25 #include "chromeos/dbus/dbus_thread_manager.h"
26 #include "content/public/browser/browser_thread.h" 26 #include "content/public/browser/browser_thread.h"
27 #include "content/public/browser/notification_service.h" 27 #include "content/public/browser/notification_service.h"
28 #include "content/public/browser/notification_types.h" 28 #include "content/public/browser/notification_types.h"
29 #include "content/public/browser/render_widget_host_view.h" 29 #include "content/public/browser/render_widget_host_view.h"
30 #include "content/public/browser/web_ui.h" 30 #include "content/public/browser/web_ui.h"
31 #include "ui/aura/client/capture_client.h" 31 #include "ui/aura/client/capture_client.h"
32 #include "ui/aura/window_event_dispatcher.h" 32 #include "ui/aura/window_event_dispatcher.h"
33 #include "ui/base/l10n/l10n_util.h" 33 #include "ui/base/l10n/l10n_util.h"
34 #include "ui/base/ui_base_switches_util.h"
34 #include "ui/base/x/x11_util.h" 35 #include "ui/base/x/x11_util.h"
35 #include "ui/gfx/screen.h" 36 #include "ui/gfx/screen.h"
36 #include "ui/keyboard/keyboard_controller.h" 37 #include "ui/keyboard/keyboard_controller.h"
37 #include "ui/keyboard/keyboard_util.h" 38 #include "ui/keyboard/keyboard_util.h"
38 #include "ui/views/controls/webview/webview.h" 39 #include "ui/views/controls/webview/webview.h"
39 40
40 namespace { 41 namespace {
41 42
42 // URL which corresponds to the login WebUI. 43 // URL which corresponds to the login WebUI.
43 const char kLoginURL[] = "chrome://oobe/lock"; 44 const char kLoginURL[] = "chrome://oobe/lock";
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 lock_time_ = base::TimeTicks::Now(); 87 lock_time_ = base::TimeTicks::Now();
87 LockWindow* lock_window = LockWindow::Create(); 88 LockWindow* lock_window = LockWindow::Create();
88 lock_window->set_observer(this); 89 lock_window->set_observer(this);
89 lock_window_ = lock_window->GetWidget(); 90 lock_window_ = lock_window->GetWidget();
90 lock_window_->AddObserver(this); 91 lock_window_->AddObserver(this);
91 WebUILoginView::Init(); 92 WebUILoginView::Init();
92 lock_window_->SetContentsView(this); 93 lock_window_->SetContentsView(this);
93 lock_window_->Show(); 94 lock_window_->Show();
94 LoadURL(GURL(kLoginURL)); 95 LoadURL(GURL(kLoginURL));
95 lock_window->Grab(); 96 lock_window->Grab();
97 if (::switches::IsTextInputFocusManagerEnabled())
Nikita (slow) 2014/07/07 15:32:09 Can this condition be dropped?
98 RequestFocus();
96 99
97 login_display_.reset(new WebUILoginDisplay(this)); 100 login_display_.reset(new WebUILoginDisplay(this));
98 login_display_->set_background_bounds(bounds); 101 login_display_->set_background_bounds(bounds);
99 login_display_->set_parent_window(GetNativeWindow()); 102 login_display_->set_parent_window(GetNativeWindow());
100 login_display_->Init(screen_locker()->users(), false, true, false); 103 login_display_->Init(screen_locker()->users(), false, true, false);
101 104
102 GetOobeUI()->ShowSigninScreen( 105 GetOobeUI()->ShowSigninScreen(
103 LoginScreenContext(), login_display_.get(), login_display_.get()); 106 LoginScreenContext(), login_display_.get(), login_display_.get());
104 107
105 registrar_.Add(this, 108 registrar_.Add(this,
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 GetOobeUI()->GetCoreOobeActor()->ShowControlBar(false); 381 GetOobeUI()->GetCoreOobeActor()->ShowControlBar(false);
379 if (login::LoginScrollIntoViewEnabled()) 382 if (login::LoginScrollIntoViewEnabled())
380 GetOobeUI()->GetCoreOobeActor()->SetKeyboardState(true, new_bounds); 383 GetOobeUI()->GetCoreOobeActor()->SetKeyboardState(true, new_bounds);
381 } 384 }
382 } 385 }
383 386
384 keyboard_bounds_ = new_bounds; 387 keyboard_bounds_ = new_bounds;
385 } 388 }
386 389
387 } // namespace chromeos 390 } // 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