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

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

Issue 10928088: Factory reset screen is added (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed formatting Created 8 years, 3 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_view.h" 5 #include "chrome/browser/chromeos/login/webui_login_view.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray.h" 8 #include "ash/system/tray/system_tray.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 using content::WebContents; 44 using content::WebContents;
45 45
46 namespace { 46 namespace {
47 47
48 const char kViewClassName[] = "browser/chromeos/login/WebUILoginView"; 48 const char kViewClassName[] = "browser/chromeos/login/WebUILoginView";
49 49
50 // These strings must be kept in sync with handleAccelerator() in oobe.js. 50 // These strings must be kept in sync with handleAccelerator() in oobe.js.
51 const char kAccelNameCancel[] = "cancel"; 51 const char kAccelNameCancel[] = "cancel";
52 const char kAccelNameEnrollment[] = "enrollment"; 52 const char kAccelNameEnrollment[] = "enrollment";
53 const char kAccelNameVersion[] = "version"; 53 const char kAccelNameVersion[] = "version";
54 const char kAccelNameReset[] = "reset";
54 55
55 // Observes IPC messages from the FrameSniffer and notifies JS if error 56 // Observes IPC messages from the FrameSniffer and notifies JS if error
56 // appears. 57 // appears.
57 class SnifferObserver : public content::RenderViewHostObserver { 58 class SnifferObserver : public content::RenderViewHostObserver {
58 public: 59 public:
59 SnifferObserver(RenderViewHost* host, content::WebUI* webui) 60 SnifferObserver(RenderViewHost* host, content::WebUI* webui)
60 : content::RenderViewHostObserver(host), webui_(webui) { 61 : content::RenderViewHostObserver(host), webui_(webui) {
61 DCHECK(webui_); 62 DCHECK(webui_);
62 Send(new ChromeViewMsg_StartFrameSniffer(routing_id(), 63 Send(new ChromeViewMsg_StartFrameSniffer(routing_id(),
63 UTF8ToUTF16("gaia-frame"))); 64 UTF8ToUTF16("gaia-frame")));
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE, 124 chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE,
124 content::NotificationService::AllSources()); 125 content::NotificationService::AllSources());
125 126
126 accel_map_[ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)] = 127 accel_map_[ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE)] =
127 kAccelNameCancel; 128 kAccelNameCancel;
128 accel_map_[ui::Accelerator(ui::VKEY_E, 129 accel_map_[ui::Accelerator(ui::VKEY_E,
129 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = 130 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] =
130 kAccelNameEnrollment; 131 kAccelNameEnrollment;
131 accel_map_[ui::Accelerator(ui::VKEY_V, ui::EF_ALT_DOWN)] = 132 accel_map_[ui::Accelerator(ui::VKEY_V, ui::EF_ALT_DOWN)] =
132 kAccelNameVersion; 133 kAccelNameVersion;
134 accel_map_[ui::Accelerator(ui::VKEY_R,
135 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] =
136 kAccelNameReset;
133 137
134 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) 138 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i)
135 AddAccelerator(i->first); 139 AddAccelerator(i->first);
136 } 140 }
137 141
138 WebUILoginView::~WebUILoginView() { 142 WebUILoginView::~WebUILoginView() {
139 ash::SystemTray* tray = ash::Shell::GetInstance()->system_tray(); 143 ash::SystemTray* tray = ash::Shell::GetInstance()->system_tray();
140 if (tray) 144 if (tray)
141 tray->SetNextFocusableView(NULL); 145 tray->SetNextFocusableView(NULL);
142 } 146 }
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 aura::Env::GetInstance()->set_render_white_bg(true); 376 aura::Env::GetInstance()->set_render_white_bg(true);
373 } 377 }
374 378
375 void WebUILoginView::ReturnFocus(bool reverse) { 379 void WebUILoginView::ReturnFocus(bool reverse) {
376 // Return the focus to the web contents. 380 // Return the focus to the web contents.
377 webui_login_->web_contents()->FocusThroughTabTraversal(reverse); 381 webui_login_->web_contents()->FocusThroughTabTraversal(reverse);
378 GetWidget()->Activate(); 382 GetWidget()->Activate();
379 } 383 }
380 384
381 } // namespace chromeos 385 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_display.cc ('k') | chrome/browser/chromeos/login/webui_screen_locker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698