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

Side by Side Diff: chrome/browser/chromeos/login/ui/login_display_host_impl.cc

Issue 363613004: [cros] Define session_manager component with SessionManager base class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review + fix build Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/login_display_host_impl.h" 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/audio/sounds.h" 9 #include "ash/audio/sounds.h"
10 #include "ash/desktop_background/desktop_background_controller.h" 10 #include "ash/desktop_background/desktop_background_controller.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 #include "chrome/common/pref_names.h" 61 #include "chrome/common/pref_names.h"
62 #include "chromeos/audio/chromeos_sounds.h" 62 #include "chromeos/audio/chromeos_sounds.h"
63 #include "chromeos/chromeos_constants.h" 63 #include "chromeos/chromeos_constants.h"
64 #include "chromeos/chromeos_switches.h" 64 #include "chromeos/chromeos_switches.h"
65 #include "chromeos/dbus/dbus_thread_manager.h" 65 #include "chromeos/dbus/dbus_thread_manager.h"
66 #include "chromeos/dbus/session_manager_client.h" 66 #include "chromeos/dbus/session_manager_client.h"
67 #include "chromeos/ime/extension_ime_util.h" 67 #include "chromeos/ime/extension_ime_util.h"
68 #include "chromeos/ime/input_method_manager.h" 68 #include "chromeos/ime/input_method_manager.h"
69 #include "chromeos/login/login_state.h" 69 #include "chromeos/login/login_state.h"
70 #include "chromeos/settings/timezone_settings.h" 70 #include "chromeos/settings/timezone_settings.h"
71 #include "components/session_manager/core/session_manager.h"
71 #include "content/public/browser/notification_service.h" 72 #include "content/public/browser/notification_service.h"
72 #include "content/public/browser/notification_types.h" 73 #include "content/public/browser/notification_types.h"
73 #include "content/public/browser/render_frame_host.h" 74 #include "content/public/browser/render_frame_host.h"
74 #include "content/public/browser/web_contents.h" 75 #include "content/public/browser/web_contents.h"
75 #include "content/public/browser/web_ui.h" 76 #include "content/public/browser/web_ui.h"
76 #include "grit/browser_resources.h" 77 #include "grit/browser_resources.h"
77 #include "media/audio/sounds/sounds_manager.h" 78 #include "media/audio/sounds/sounds_manager.h"
78 #include "ui/aura/window.h" 79 #include "ui/aura/window.h"
79 #include "ui/base/resource/resource_bundle.h" 80 #include "ui/base/resource/resource_bundle.h"
80 #include "ui/base/ui_base_switches_util.h" 81 #include "ui/base/ui_base_switches_util.h"
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight)); 1176 prefs->GetBoolean(prefs::kOwnerPrimaryMouseButtonRight));
1176 system::InputDeviceSettings::Get()->SetTapToClick( 1177 system::InputDeviceSettings::Get()->SetTapToClick(
1177 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); 1178 prefs->GetBoolean(prefs::kOwnerTapToClickEnabled));
1178 } 1179 }
1179 system::InputDeviceSettings::Get()->SetNaturalScroll( 1180 system::InputDeviceSettings::Get()->SetNaturalScroll(
1180 CommandLine::ForCurrentProcess()->HasSwitch( 1181 CommandLine::ForCurrentProcess()->HasSwitch(
1181 switches::kNaturalScrollDefault)); 1182 switches::kNaturalScrollDefault));
1182 1183
1183 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); 1184 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size()));
1184 1185
1186 // Check whether we need to execute OOBE flow.
1187 bool oobe_complete = chromeos::StartupUtils::IsOobeCompleted();
oshima 2014/07/14 20:03:53 or next_state = IsOobeCompleted() ? STATE_LOGIN_PR
Nikita (slow) 2014/07/15 10:18:43 Done.
1188 if (!oobe_complete) {
1189 g_browser_process->platform_part()->session_manager()->SetSessionState(
1190 session_manager::SessionManager::SESSION_STATE_OOBE);
1191 } else {
1192 g_browser_process->platform_part()->session_manager()->SetSessionState(
1193 session_manager::SessionManager::SESSION_STATE_LOGIN_PRIMARY);
1194 }
1195
1185 LoginDisplayHost* display_host = new LoginDisplayHostImpl(screen_bounds); 1196 LoginDisplayHost* display_host = new LoginDisplayHostImpl(screen_bounds);
1186 1197
1187 bool show_app_launch_splash_screen = (first_screen_name == 1198 bool show_app_launch_splash_screen = (first_screen_name ==
1188 chromeos::WizardController::kAppLaunchSplashScreenName); 1199 chromeos::WizardController::kAppLaunchSplashScreenName);
1189 if (show_app_launch_splash_screen) { 1200 if (show_app_launch_splash_screen) {
1190 const std::string& auto_launch_app_id = 1201 const std::string& auto_launch_app_id =
1191 chromeos::KioskAppManager::Get()->GetAutoLaunchApp(); 1202 chromeos::KioskAppManager::Get()->GetAutoLaunchApp();
1192 display_host->StartAppLaunch(auto_launch_app_id, 1203 display_host->StartAppLaunch(auto_launch_app_id,
1193 false /* diagnostic_mode */); 1204 false /* diagnostic_mode */);
1194 return; 1205 return;
1195 } 1206 }
1196 1207
1197 // Check whether we need to execute OOBE process.
1198 bool oobe_complete = chromeos::StartupUtils::IsOobeCompleted();
1199 policy::BrowserPolicyConnectorChromeOS* connector = 1208 policy::BrowserPolicyConnectorChromeOS* connector =
1200 g_browser_process->platform_part()->browser_policy_connector_chromeos(); 1209 g_browser_process->platform_part()->browser_policy_connector_chromeos();
1201 bool enrollment_screen_wanted = 1210 bool enrollment_screen_wanted =
1202 chromeos::WizardController::ShouldRecoverEnrollment() || 1211 chromeos::WizardController::ShouldRecoverEnrollment() ||
1203 (chromeos::WizardController::ShouldAutoStartEnrollment() && 1212 (chromeos::WizardController::ShouldAutoStartEnrollment() &&
1204 oobe_complete && 1213 oobe_complete &&
1205 !connector->IsEnterpriseManaged()); 1214 !connector->IsEnterpriseManaged());
1206 if (enrollment_screen_wanted && first_screen_name.empty()) { 1215 if (enrollment_screen_wanted && first_screen_name.empty()) {
1207 // Shows networks screen instead of enrollment screen to resume the 1216 // Shows networks screen instead of enrollment screen to resume the
1208 // interrupted auto start enrollment flow because enrollment screen does 1217 // interrupted auto start enrollment flow because enrollment screen does
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 scoped_ptr<locale_util::SwitchLanguageCallback> callback( 1277 scoped_ptr<locale_util::SwitchLanguageCallback> callback(
1269 new locale_util::SwitchLanguageCallback( 1278 new locale_util::SwitchLanguageCallback(
1270 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); 1279 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass()))));
1271 1280
1272 // Load locale keyboards here. Hardware layout would be automatically enabled. 1281 // Load locale keyboards here. Hardware layout would be automatically enabled.
1273 locale_util::SwitchLanguage( 1282 locale_util::SwitchLanguage(
1274 locale, true, true /* login_layouts_only */, callback.Pass()); 1283 locale, true, true /* login_layouts_only */, callback.Pass());
1275 } 1284 }
1276 1285
1277 } // namespace chromeos 1286 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698