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

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

Issue 55423004: Enable Google Drive offline mode automatically on first run. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed to DriveFirstRunController Created 7 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/login_display_host_impl.h" 5 #include "chrome/browser/chromeos/login/login_display_host_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/desktop_background/desktop_background_controller.h" 9 #include "ash/desktop_background/desktop_background_controller.h"
10 #include "ash/desktop_background/user_wallpaper_delegate.h" 10 #include "ash/desktop_background/user_wallpaper_delegate.h"
11 #include "ash/shell.h" 11 #include "ash/shell.h"
12 #include "ash/shell_window_ids.h" 12 #include "ash/shell_window_ids.h"
13 #include "ash/wm/header_painter.h" 13 #include "ash/wm/header_painter.h"
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/debug/trace_event.h" 16 #include "base/debug/trace_event.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/prefs/pref_service.h" 18 #include "base/prefs/pref_service.h"
19 #include "base/strings/utf_string_conversions.h" 19 #include "base/strings/utf_string_conversions.h"
20 #include "base/threading/thread_restrictions.h" 20 #include "base/threading/thread_restrictions.h"
21 #include "base/time/time.h" 21 #include "base/time/time.h"
22 #include "base/values.h" 22 #include "base/values.h"
23 #include "chrome/browser/browser_process.h" 23 #include "chrome/browser/browser_process.h"
24 #include "chrome/browser/browser_shutdown.h" 24 #include "chrome/browser/browser_shutdown.h"
25 #include "chrome/browser/chrome_notification_types.h" 25 #include "chrome/browser/chrome_notification_types.h"
26 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" 26 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h"
27 #include "chrome/browser/chromeos/customization_document.h" 27 #include "chrome/browser/chromeos/customization_document.h"
28 #include "chrome/browser/chromeos/first_run/drive_first_run_controller.h"
28 #include "chrome/browser/chromeos/first_run/first_run_controller.h" 29 #include "chrome/browser/chromeos/first_run/first_run_controller.h"
29 #include "chrome/browser/chromeos/input_method/input_method_util.h" 30 #include "chrome/browser/chromeos/input_method/input_method_util.h"
30 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" 31 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
31 #include "chrome/browser/chromeos/language_preferences.h" 32 #include "chrome/browser/chromeos/language_preferences.h"
32 #include "chrome/browser/chromeos/login/existing_user_controller.h" 33 #include "chrome/browser/chromeos/login/existing_user_controller.h"
33 #include "chrome/browser/chromeos/login/helper.h" 34 #include "chrome/browser/chromeos/login/helper.h"
34 #include "chrome/browser/chromeos/login/language_switch_menu.h" 35 #include "chrome/browser/chromeos/login/language_switch_menu.h"
35 #include "chrome/browser/chromeos/login/login_utils.h" 36 #include "chrome/browser/chromeos/login/login_utils.h"
36 #include "chrome/browser/chromeos/login/login_wizard.h" 37 #include "chrome/browser/chromeos/login/login_wizard.h"
37 #include "chrome/browser/chromeos/login/oobe_display.h" 38 #include "chrome/browser/chromeos/login/oobe_display.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 chrome::EndKeepAlive(); 291 chrome::EndKeepAlive();
291 292
292 default_host_ = NULL; 293 default_host_ = NULL;
293 // TODO(dzhioev): find better place for starting tutorial. 294 // TODO(dzhioev): find better place for starting tutorial.
294 if (CommandLine::ForCurrentProcess()-> 295 if (CommandLine::ForCurrentProcess()->
295 HasSwitch(switches::kEnableFirstRunUI)) { 296 HasSwitch(switches::kEnableFirstRunUI)) {
296 // FirstRunController manages its lifetime and destructs after tutorial 297 // FirstRunController manages its lifetime and destructs after tutorial
297 // completion. 298 // completion.
298 (new FirstRunController())->Start(); 299 (new FirstRunController())->Start();
299 } 300 }
301
302 #if defined(GOOGLE_CHROME_BUILD)
achuithb 2013/11/04 20:33:24 Why only for official builds?
Tim Song 2013/11/05 01:18:06 We won't have the Drive app installed by default i
achuithb 2013/11/05 01:23:06 The code handles this case though right? It fails
303 // TODO(tengs): This should be refactored together with the first run UI.
304 if (CommandLine::ForCurrentProcess()->HasSwitch(
305 switches::kEnableDriveOfflineFirstRun)) {
306 if (UserManager::Get()->IsCurrentUserNew()) {
307 // DriveOptInController will delete itself when finished.
308 (new DriveFirstRunController())->EnableOfflineMode();
309 }
310 }
311 #endif
300 } 312 }
301 313
302 //////////////////////////////////////////////////////////////////////////////// 314 ////////////////////////////////////////////////////////////////////////////////
303 // LoginDisplayHostImpl, LoginDisplayHost implementation: 315 // LoginDisplayHostImpl, LoginDisplayHost implementation:
304 316
305 LoginDisplay* LoginDisplayHostImpl::CreateLoginDisplay( 317 LoginDisplay* LoginDisplayHostImpl::CreateLoginDisplay(
306 LoginDisplay::Delegate* delegate) { 318 LoginDisplay::Delegate* delegate) {
307 if (system::keyboard_settings::ForceKeyboardDrivenUINavigation()) { 319 if (system::keyboard_settings::ForceKeyboardDrivenUINavigation()) {
308 views::FocusManager::set_arrow_key_traversal_enabled(true); 320 views::FocusManager::set_arrow_key_traversal_enabled(true);
309 321
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 VLOG(1) << "Initial time zone: " << timezone_name; 1045 VLOG(1) << "Initial time zone: " << timezone_name;
1034 // Apply locale customizations only once to preserve whatever locale 1046 // Apply locale customizations only once to preserve whatever locale
1035 // user has changed to during OOBE. 1047 // user has changed to during OOBE.
1036 if (!timezone_name.empty()) { 1048 if (!timezone_name.empty()) {
1037 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID( 1049 chromeos::system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
1038 UTF8ToUTF16(timezone_name)); 1050 UTF8ToUTF16(timezone_name));
1039 } 1051 }
1040 } 1052 }
1041 1053
1042 } // namespace chromeos 1054 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698