OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/background_view.h" | 5 #include "chrome/browser/chromeos/login/background_view.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
11 #include "app/x11_util.h" | 11 #include "app/x11_util.h" |
12 #include "base/string16.h" | 12 #include "base/string16.h" |
13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
16 #include "chrome/browser/chromeos/login/helper.h" | 16 #include "chrome/browser/chromeos/login/helper.h" |
17 #include "chrome/browser/chromeos/login/oobe_progress_bar.h" | 17 #include "chrome/browser/chromeos/login/oobe_progress_bar.h" |
| 18 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" |
18 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 19 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
19 #include "chrome/browser/chromeos/login/shutdown_button.h" | 20 #include "chrome/browser/chromeos/login/shutdown_button.h" |
20 #include "chrome/browser/chromeos/login/wizard_controller.h" | 21 #include "chrome/browser/chromeos/login/wizard_controller.h" |
21 #include "chrome/browser/chromeos/status/clock_menu_button.h" | 22 #include "chrome/browser/chromeos/status/clock_menu_button.h" |
22 #include "chrome/browser/chromeos/status/feedback_menu_button.h" | 23 #include "chrome/browser/chromeos/status/feedback_menu_button.h" |
23 #include "chrome/browser/chromeos/status/input_method_menu_button.h" | 24 #include "chrome/browser/chromeos/status/input_method_menu_button.h" |
24 #include "chrome/browser/chromeos/status/network_menu_button.h" | 25 #include "chrome/browser/chromeos/status/network_menu_button.h" |
25 #include "chrome/browser/chromeos/status/status_area_view.h" | 26 #include "chrome/browser/chromeos/status/status_area_view.h" |
26 #include "chrome/browser/chromeos/wm_ipc.h" | 27 #include "chrome/browser/chromeos/wm_ipc.h" |
27 #include "chrome/browser/profile_manager.h" | 28 #include "chrome/browser/profile_manager.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 SchedulePaint(); | 256 SchedulePaint(); |
256 } | 257 } |
257 | 258 |
258 gfx::NativeWindow BackgroundView::GetNativeWindow() const { | 259 gfx::NativeWindow BackgroundView::GetNativeWindow() const { |
259 return | 260 return |
260 GTK_WINDOW(static_cast<WidgetGtk*>(GetWidget())->GetNativeView()); | 261 GTK_WINDOW(static_cast<WidgetGtk*>(GetWidget())->GetNativeView()); |
261 } | 262 } |
262 | 263 |
263 bool BackgroundView::ShouldOpenButtonOptions( | 264 bool BackgroundView::ShouldOpenButtonOptions( |
264 const views::View* button_view) const { | 265 const views::View* button_view) const { |
| 266 if (button_view == status_area_->network_view()) { |
| 267 return true; |
| 268 } |
265 if (button_view == status_area_->clock_view() || | 269 if (button_view == status_area_->clock_view() || |
266 button_view == status_area_->feedback_view() || | 270 button_view == status_area_->feedback_view() || |
267 button_view == status_area_->input_method_view() || | 271 button_view == status_area_->input_method_view()) { |
268 button_view == status_area_->network_view()) { | |
269 return false; | 272 return false; |
270 } | 273 } |
271 return true; | 274 return true; |
272 } | 275 } |
273 | 276 |
274 void BackgroundView::OpenButtonOptions(const views::View* button_view) const { | 277 void BackgroundView::OpenButtonOptions(const views::View* button_view) { |
275 // TODO(avayvod): Add some dialog for options or remove them completely. | 278 if (button_view == status_area_->network_view()) { |
| 279 if (proxy_settings_dialog_.get() == NULL) { |
| 280 proxy_settings_dialog_.reset(new ProxySettingsDialog( |
| 281 this, GetNativeWindow())); |
| 282 } |
| 283 proxy_settings_dialog_->Show(); |
| 284 } |
276 } | 285 } |
277 | 286 |
278 bool BackgroundView::IsBrowserMode() const { | 287 bool BackgroundView::IsBrowserMode() const { |
279 return false; | 288 return false; |
280 } | 289 } |
281 | 290 |
282 bool BackgroundView::IsScreenLockerMode() const { | 291 bool BackgroundView::IsScreenLockerMode() const { |
283 return false; | 292 return false; |
284 } | 293 } |
285 | 294 |
| 295 // Overridden from LoginHtmlDialog::Delegate: |
| 296 void BackgroundView::OnLocaleChanged() { |
| 297 // Proxy settings dialog contains localized strings. |
| 298 proxy_settings_dialog_.reset(); |
| 299 } |
| 300 |
286 /////////////////////////////////////////////////////////////////////////////// | 301 /////////////////////////////////////////////////////////////////////////////// |
287 // BackgroundView private: | 302 // BackgroundView private: |
288 | 303 |
289 void BackgroundView::InitStatusArea() { | 304 void BackgroundView::InitStatusArea() { |
290 DCHECK(status_area_ == NULL); | 305 DCHECK(status_area_ == NULL); |
291 status_area_ = new StatusAreaView(this); | 306 status_area_ = new StatusAreaView(this); |
292 status_area_->Init(); | 307 status_area_->Init(); |
293 // Feedback button shoudn't be visible on OOBE/login/screen lock. | 308 // Feedback button shoudn't be visible on OOBE/login/screen lock. |
294 status_area_->feedback_view()->SetVisible(false); | 309 status_area_->feedback_view()->SetVisible(false); |
295 AddChildView(status_area_); | 310 AddChildView(status_area_); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 boot_times.total, | 403 boot_times.total, |
389 boot_times.firmware, | 404 boot_times.firmware, |
390 boot_times.pre_startup, | 405 boot_times.pre_startup, |
391 boot_times.system); | 406 boot_times.system); |
392 } | 407 } |
393 // Use UTF8ToWide once this string is localized. | 408 // Use UTF8ToWide once this string is localized. |
394 boot_times_label_->SetText(ASCIIToWide(boot_times_text)); | 409 boot_times_label_->SetText(ASCIIToWide(boot_times_text)); |
395 } | 410 } |
396 | 411 |
397 } // namespace chromeos | 412 } // namespace chromeos |
OLD | NEW |