| 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/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 | 9 |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| 11 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
| 12 #include "app/x11_util.h" | 12 #include "app/x11_util.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "chrome/browser/chromeos/login/helper.h" | 17 #include "chrome/browser/chromeos/login/helper.h" |
| 18 #include "chrome/browser/chromeos/login/login_utils.h" |
| 18 #include "chrome/browser/chromeos/login/oobe_progress_bar.h" | 19 #include "chrome/browser/chromeos/login/oobe_progress_bar.h" |
| 19 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" | 20 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" |
| 20 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 21 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
| 21 #include "chrome/browser/chromeos/login/shutdown_button.h" | 22 #include "chrome/browser/chromeos/login/shutdown_button.h" |
| 22 #include "chrome/browser/chromeos/login/wizard_controller.h" | 23 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 23 #include "chrome/browser/chromeos/status/clock_menu_button.h" | 24 #include "chrome/browser/chromeos/status/clock_menu_button.h" |
| 24 #include "chrome/browser/chromeos/status/input_method_menu_button.h" | 25 #include "chrome/browser/chromeos/status/input_method_menu_button.h" |
| 25 #include "chrome/browser/chromeos/status/network_menu_button.h" | 26 #include "chrome/browser/chromeos/status/network_menu_button.h" |
| 26 #include "chrome/browser/chromeos/status/status_area_view.h" | 27 #include "chrome/browser/chromeos/status/status_area_view.h" |
| 27 #include "chrome/browser/chromeos/wm_ipc.h" | 28 #include "chrome/browser/chromeos/wm_ipc.h" |
| 28 #include "chrome/browser/profiles/profile_manager.h" | 29 #include "chrome/browser/profiles/profile_manager.h" |
| 29 #include "chrome/browser/ui/views/dom_view.h" | 30 #include "chrome/browser/ui/views/dom_view.h" |
| 31 #include "chrome/browser/ui/views/window.h" |
| 30 #include "gfx/gtk_util.h" | 32 #include "gfx/gtk_util.h" |
| 31 #include "googleurl/src/gurl.h" | 33 #include "googleurl/src/gurl.h" |
| 32 #include "grit/chromium_strings.h" | 34 #include "grit/chromium_strings.h" |
| 33 #include "grit/generated_resources.h" | 35 #include "grit/generated_resources.h" |
| 34 #include "grit/theme_resources.h" | 36 #include "grit/theme_resources.h" |
| 35 #include "third_party/cros/chromeos_wm_ipc_enums.h" | 37 #include "third_party/cros/chromeos_wm_ipc_enums.h" |
| 36 #include "views/controls/button/text_button.h" | 38 #include "views/controls/button/text_button.h" |
| 37 #include "views/controls/label.h" | 39 #include "views/controls/label.h" |
| 38 #include "views/screen.h" | 40 #include "views/screen.h" |
| 39 #include "views/widget/widget_gtk.h" | 41 #include "views/widget/widget_gtk.h" |
| 42 #include "views/window/window.h" |
| 40 | 43 |
| 41 // X Windows headers have "#define Status int". That interferes with | 44 // X Windows headers have "#define Status int". That interferes with |
| 42 // NetworkLibrary header which defines enum "Status". | 45 // NetworkLibrary header which defines enum "Status". |
| 43 #include <X11/cursorfont.h> // NOLINT | 46 #include <X11/cursorfont.h> // NOLINT |
| 44 #include <X11/Xcursor/Xcursor.h> // NOLINT | 47 #include <X11/Xcursor/Xcursor.h> // NOLINT |
| 45 | 48 |
| 46 using views::WidgetGtk; | 49 using views::WidgetGtk; |
| 47 | 50 |
| 48 namespace { | 51 namespace { |
| 49 | 52 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 (*view)->ShowScreenSaver(); | 175 (*view)->ShowScreenSaver(); |
| 173 | 176 |
| 174 window->SetContentsView(*view); | 177 window->SetContentsView(*view); |
| 175 | 178 |
| 176 (*view)->UpdateWindowType(); | 179 (*view)->UpdateWindowType(); |
| 177 | 180 |
| 178 // This keeps the window from flashing at startup. | 181 // This keeps the window from flashing at startup. |
| 179 GdkWindow* gdk_window = window->GetNativeView()->window; | 182 GdkWindow* gdk_window = window->GetNativeView()->window; |
| 180 gdk_window_set_back_pixmap(gdk_window, NULL, false); | 183 gdk_window_set_back_pixmap(gdk_window, NULL, false); |
| 181 | 184 |
| 185 LoginUtils::Get()->SetBackgroundView(*view); |
| 186 |
| 182 return window; | 187 return window; |
| 183 } | 188 } |
| 184 | 189 |
| 190 void BackgroundView::CreateModalPopup(views::WindowDelegate* view) { |
| 191 views::Window* window = browser::CreateViewsWindow( |
| 192 GetNativeWindow(), gfx::Rect(), view); |
| 193 window->SetIsAlwaysOnTop(true); |
| 194 window->Show(); |
| 195 } |
| 196 |
| 185 void BackgroundView::SetStatusAreaVisible(bool visible) { | 197 void BackgroundView::SetStatusAreaVisible(bool visible) { |
| 186 status_area_->SetVisible(visible); | 198 status_area_->SetVisible(visible); |
| 187 } | 199 } |
| 188 | 200 |
| 189 void BackgroundView::SetStatusAreaEnabled(bool enable) { | 201 void BackgroundView::SetStatusAreaEnabled(bool enable) { |
| 190 status_area_->EnableButtons(enable); | 202 status_area_->EnableButtons(enable); |
| 191 } | 203 } |
| 192 | 204 |
| 193 void BackgroundView::SetOobeProgressBarVisible(bool visible) { | 205 void BackgroundView::SetOobeProgressBarVisible(bool visible) { |
| 194 if (!progress_bar_ && visible) | 206 if (!progress_bar_ && visible) |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 kBootTimesNoChromeExec, | 448 kBootTimesNoChromeExec, |
| 437 boot_times.total, | 449 boot_times.total, |
| 438 boot_times.pre_startup, | 450 boot_times.pre_startup, |
| 439 boot_times.system); | 451 boot_times.system); |
| 440 } | 452 } |
| 441 // Use UTF8ToWide once this string is localized. | 453 // Use UTF8ToWide once this string is localized. |
| 442 boot_times_label_->SetText(ASCIIToWide(boot_times_text)); | 454 boot_times_label_->SetText(ASCIIToWide(boot_times_text)); |
| 443 } | 455 } |
| 444 | 456 |
| 445 } // namespace chromeos | 457 } // namespace chromeos |
| OLD | NEW |