| 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/new_user_view.h" | 5 #include "chrome/browser/chromeos/login/new_user_view.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <sys/types.h> | 8 #include <sys/types.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/message_loop.h" | 15 #include "base/message_loop.h" |
| 16 #include "base/process_util.h" | 16 #include "base/process_util.h" |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 19 #include "chrome/browser/browser_process.h" | 19 #include "chrome/browser/browser_process.h" |
| 20 #include "chrome/browser/chromeos/cros/cros_library.h" | 20 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 21 #include "chrome/browser/chromeos/cros_settings.h" |
| 21 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 22 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
| 22 #include "chrome/browser/chromeos/login/textfield_with_margin.h" | 23 #include "chrome/browser/chromeos/login/textfield_with_margin.h" |
| 23 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" | 24 #include "chrome/browser/chromeos/login/wizard_accessibility_helper.h" |
| 24 #include "chrome/browser/chromeos/user_cros_settings_provider.h" | |
| 25 #include "chrome/browser/chromeos/views/copy_background.h" | 25 #include "chrome/browser/chromeos/views/copy_background.h" |
| 26 #include "chrome/browser/prefs/pref_service.h" | 26 #include "chrome/browser/prefs/pref_service.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "grit/chromium_strings.h" | 28 #include "grit/chromium_strings.h" |
| 29 #include "grit/generated_resources.h" | 29 #include "grit/generated_resources.h" |
| 30 #include "grit/ui_resources.h" | 30 #include "grit/ui_resources.h" |
| 31 #include "ui/base/keycodes/keyboard_codes.h" | 31 #include "ui/base/keycodes/keyboard_codes.h" |
| 32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
| 33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
| 34 #include "ui/gfx/font.h" | 34 #include "ui/gfx/font.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 accel_login_off_the_record_(ui::VKEY_B, false, false, true), | 123 accel_login_off_the_record_(ui::VKEY_B, false, false, true), |
| 124 accel_toggle_accessibility_(WizardAccessibilityHelper::GetAccelerator()), | 124 accel_toggle_accessibility_(WizardAccessibilityHelper::GetAccelerator()), |
| 125 delegate_(delegate), | 125 delegate_(delegate), |
| 126 ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)), | 126 ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)), |
| 127 login_in_process_(false), | 127 login_in_process_(false), |
| 128 need_border_(need_border), | 128 need_border_(need_border), |
| 129 need_guest_link_(false), | 129 need_guest_link_(false), |
| 130 need_create_account_(false), | 130 need_create_account_(false), |
| 131 languages_menubutton_order_(-1), | 131 languages_menubutton_order_(-1), |
| 132 sign_in_button_order_(-1) { | 132 sign_in_button_order_(-1) { |
| 133 if (UserCrosSettingsProvider::cached_allow_guest()) { | 133 bool allow_guest = false; |
| 134 // TODO(pastarmovj): Make this class an observer of the CrosSettings to be |
| 135 // able to update the UI whenever policy is loaded. |
| 136 CrosSettings::Get()->GetBoolean(kAccountsPrefAllowGuest, &allow_guest); |
| 137 if (allow_guest) { |
| 134 need_create_account_ = true; | 138 need_create_account_ = true; |
| 135 if (need_guest_link) | 139 if (need_guest_link) |
| 136 need_guest_link_ = true; | 140 need_guest_link_ = true; |
| 137 } | 141 } |
| 138 } | 142 } |
| 139 | 143 |
| 140 NewUserView::~NewUserView() { | 144 NewUserView::~NewUserView() { |
| 141 } | 145 } |
| 142 | 146 |
| 143 void NewUserView::Init() { | 147 void NewUserView::Init() { |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 576 |
| 573 void NewUserView::InitLink(views::Link** link) { | 577 void NewUserView::InitLink(views::Link** link) { |
| 574 *link = new views::Link(std::wstring()); | 578 *link = new views::Link(std::wstring()); |
| 575 (*link)->set_listener(this); | 579 (*link)->set_listener(this); |
| 576 (*link)->SetNormalColor(login::kLinkColor); | 580 (*link)->SetNormalColor(login::kLinkColor); |
| 577 (*link)->SetHighlightedColor(login::kLinkColor); | 581 (*link)->SetHighlightedColor(login::kLinkColor); |
| 578 AddChildView(*link); | 582 AddChildView(*link); |
| 579 } | 583 } |
| 580 | 584 |
| 581 } // namespace chromeos | 585 } // namespace chromeos |
| OLD | NEW |