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_login_view.h" | 5 #include "chrome/browser/chromeos/login/webui_login_view.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/accessibility_util.h" | 7 #include "chrome/browser/chromeos/accessibility_util.h" |
8 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" | 8 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" |
9 #include "chrome/browser/chromeos/login/webui_login_display.h" | 9 #include "chrome/browser/chromeos/login/webui_login_display.h" |
10 #include "chrome/browser/chromeos/status/clock_menu_button.h" | 10 #include "chrome/browser/chromeos/status/clock_menu_button.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 // static | 39 // static |
40 const int WebUILoginView::kStatusAreaCornerPadding = 5; | 40 const int WebUILoginView::kStatusAreaCornerPadding = 5; |
41 | 41 |
42 // WebUILoginView public: ------------------------------------------------------ | 42 // WebUILoginView public: ------------------------------------------------------ |
43 | 43 |
44 WebUILoginView::WebUILoginView() | 44 WebUILoginView::WebUILoginView() |
45 : status_area_(NULL), | 45 : status_area_(NULL), |
46 profile_(NULL), | 46 profile_(NULL), |
47 webui_login_(NULL), | 47 webui_login_(NULL), |
48 status_window_(NULL), | 48 status_window_(NULL), |
49 host_window_frozen_(false) { | 49 host_window_frozen_(false), |
| 50 status_area_visibility_on_init_(true) { |
50 #if defined(TOUCH_UI) | 51 #if defined(TOUCH_UI) |
51 // Make sure the singleton KeyboardManager object is created. | 52 // Make sure the singleton KeyboardManager object is created. |
52 KeyboardManager::GetInstance(); | 53 KeyboardManager::GetInstance(); |
53 #endif | 54 #endif |
54 accel_map_[views::Accelerator(ui::VKEY_Z, false, true, true)] = | 55 accel_map_[views::Accelerator(ui::VKEY_Z, false, true, true)] = |
55 kAccelNameAccessibility; | 56 kAccelNameAccessibility; |
56 accel_map_[views::Accelerator(ui::VKEY_E, false, true, true)] = | 57 accel_map_[views::Accelerator(ui::VKEY_E, false, true, true)] = |
57 kAccelNameEnrollment; | 58 kAccelNameEnrollment; |
58 | 59 |
59 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) | 60 for (AccelMap::iterator i(accel_map_.begin()); i != accel_map_.end(); ++i) |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 131 } |
131 | 132 |
132 void WebUILoginView::SetStatusAreaEnabled(bool enable) { | 133 void WebUILoginView::SetStatusAreaEnabled(bool enable) { |
133 if (status_area_) | 134 if (status_area_) |
134 status_area_->MakeButtonsActive(enable); | 135 status_area_->MakeButtonsActive(enable); |
135 } | 136 } |
136 | 137 |
137 void WebUILoginView::SetStatusAreaVisible(bool visible) { | 138 void WebUILoginView::SetStatusAreaVisible(bool visible) { |
138 if (status_area_) | 139 if (status_area_) |
139 status_area_->SetVisible(visible); | 140 status_area_->SetVisible(visible); |
| 141 else |
| 142 status_area_visibility_on_init_ = visible; |
140 } | 143 } |
141 | 144 |
142 // WebUILoginView protected: --------------------------------------------------- | 145 // WebUILoginView protected: --------------------------------------------------- |
143 | 146 |
144 void WebUILoginView::Layout() { | 147 void WebUILoginView::Layout() { |
145 DCHECK(webui_login_); | 148 DCHECK(webui_login_); |
146 webui_login_->SetBoundsRect(bounds()); | 149 webui_login_->SetBoundsRect(bounds()); |
147 } | 150 } |
148 | 151 |
149 void WebUILoginView::ChildPreferredSizeChanged(View* child) { | 152 void WebUILoginView::ChildPreferredSizeChanged(View* child) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( | 217 views::NativeWidgetGtk::UpdateFreezeUpdatesProperty( |
215 GetNativeWindow(), false); | 218 GetNativeWindow(), false); |
216 } | 219 } |
217 } | 220 } |
218 | 221 |
219 void WebUILoginView::InitStatusArea() { | 222 void WebUILoginView::InitStatusArea() { |
220 DCHECK(status_area_ == NULL); | 223 DCHECK(status_area_ == NULL); |
221 DCHECK(status_window_ == NULL); | 224 DCHECK(status_window_ == NULL); |
222 status_area_ = new StatusAreaView(this); | 225 status_area_ = new StatusAreaView(this); |
223 status_area_->Init(); | 226 status_area_->Init(); |
| 227 status_area_->SetVisible(status_area_visibility_on_init_); |
224 | 228 |
225 views::Widget* login_window = WebUILoginDisplay::GetLoginWindow(); | 229 views::Widget* login_window = WebUILoginDisplay::GetLoginWindow(); |
226 gfx::Size size = status_area_->GetPreferredSize(); | 230 gfx::Size size = status_area_->GetPreferredSize(); |
227 gfx::Rect bounds(width() - size.width() - kStatusAreaCornerPadding, | 231 gfx::Rect bounds(width() - size.width() - kStatusAreaCornerPadding, |
228 kStatusAreaCornerPadding, | 232 kStatusAreaCornerPadding, |
229 size.width(), | 233 size.width(), |
230 size.height()); | 234 size.height()); |
231 | 235 |
232 views::Widget::InitParams widget_params( | 236 views::Widget::InitParams widget_params( |
233 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 237 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 GetFocusManager()); | 275 GetFocusManager()); |
272 | 276 |
273 // Make sure error bubble is cleared on keyboard event. This is needed | 277 // Make sure error bubble is cleared on keyboard event. This is needed |
274 // when the focus is inside an iframe. | 278 // when the focus is inside an iframe. |
275 WebUI* web_ui = GetWebUI(); | 279 WebUI* web_ui = GetWebUI(); |
276 if (web_ui) | 280 if (web_ui) |
277 web_ui->CallJavascriptFunction("cr.ui.Oobe.clearErrors"); | 281 web_ui->CallJavascriptFunction("cr.ui.Oobe.clearErrors"); |
278 } | 282 } |
279 | 283 |
280 } // namespace chromeos | 284 } // namespace chromeos |
OLD | NEW |