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

Side by Side Diff: chrome/browser/chromeos/chrome_browser_main_chromeos.cc

Issue 9314031: Make sure even if chrome crashes on login we properly populate the use_shared_proxies pref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/chrome_browser_main_chromeos.h" 5 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 29 matching lines...) Expand all
40 #include "chrome/browser/chromeos/system/runtime_environment.h" 40 #include "chrome/browser/chromeos/system/runtime_environment.h"
41 #include "chrome/browser/chromeos/system/statistics_provider.h" 41 #include "chrome/browser/chromeos/system/statistics_provider.h"
42 #include "chrome/browser/chromeos/system_key_event_listener.h" 42 #include "chrome/browser/chromeos/system_key_event_listener.h"
43 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h" 43 #include "chrome/browser/chromeos/upgrade_detector_chromeos.h"
44 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" 44 #include "chrome/browser/chromeos/web_socket_proxy_controller.h"
45 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h" 45 #include "chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h"
46 #include "chrome/browser/defaults.h" 46 #include "chrome/browser/defaults.h"
47 #include "chrome/browser/metrics/metrics_service.h" 47 #include "chrome/browser/metrics/metrics_service.h"
48 #include "chrome/browser/oom_priority_manager.h" 48 #include "chrome/browser/oom_priority_manager.h"
49 #include "chrome/browser/policy/browser_policy_connector.h" 49 #include "chrome/browser/policy/browser_policy_connector.h"
50 #include "chrome/browser/prefs/pref_service.h"
50 #include "chrome/browser/profiles/profile.h" 51 #include "chrome/browser/profiles/profile.h"
51 #include "chrome/browser/profiles/profile_manager.h" 52 #include "chrome/browser/profiles/profile_manager.h"
52 #include "chrome/browser/ui/views/browser_dialogs.h" 53 #include "chrome/browser/ui/views/browser_dialogs.h"
53 #include "chrome/common/chrome_switches.h" 54 #include "chrome/common/chrome_switches.h"
54 #include "chrome/common/logging_chrome.h" 55 #include "chrome/common/logging_chrome.h"
56 #include "chrome/common/pref_names.h"
55 #include "content/public/common/main_function_params.h" 57 #include "content/public/common/main_function_params.h"
56 #include "grit/platform_locale_settings.h" 58 #include "grit/platform_locale_settings.h"
57 #include "net/base/network_change_notifier.h" 59 #include "net/base/network_change_notifier.h"
58 #include "net/url_request/url_request.h" 60 #include "net/url_request/url_request.h"
59 #include "ui/base/l10n/l10n_util.h" 61 #include "ui/base/l10n/l10n_util.h"
60 62
61 #if defined(TOOLKIT_USES_GTK) 63 #if defined(TOOLKIT_USES_GTK)
62 #include <gtk/gtk.h> 64 #include <gtk/gtk.h>
63 #endif 65 #endif
64 66
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 } 395 }
394 396
395 // In Aura builds this will initialize ash::Shell. 397 // In Aura builds this will initialize ash::Shell.
396 ChromeBrowserMainPartsLinux::PreProfileInit(); 398 ChromeBrowserMainPartsLinux::PreProfileInit();
397 } 399 }
398 400
399 void ChromeBrowserMainPartsChromeos::PostProfileInit() { 401 void ChromeBrowserMainPartsChromeos::PostProfileInit() {
400 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun() 402 // -- This used to be in ChromeBrowserMainParts::PreMainMessageLoopRun()
401 // -- just after CreateProfile(). 403 // -- just after CreateProfile().
402 404
403 // Pass the TokenService pointer to the policy connector so user policy can
404 // grab a token and register with the policy server.
405 // TODO(mnissler): Remove once OAuth is the only authentication mechanism.
406 if (parsed_command_line().HasSwitch(switches::kLoginUser) && 405 if (parsed_command_line().HasSwitch(switches::kLoginUser) &&
407 !parsed_command_line().HasSwitch(switches::kLoginPassword)) { 406 !parsed_command_line().HasSwitch(switches::kLoginPassword)) {
407 // Pass the TokenService pointer to the policy connector so user policy can
408 // grab a token and register with the policy server.
409 // TODO(mnissler): Remove once OAuth is the only authentication mechanism.
408 g_browser_process->browser_policy_connector()->SetUserPolicyTokenService( 410 g_browser_process->browser_policy_connector()->SetUserPolicyTokenService(
409 profile()->GetTokenService()); 411 profile()->GetTokenService());
412
413 // Make sure we flip every profile to not share proxies if the user hasn't
414 // specified so explicitly.
415 const PrefService::Preference* use_shared_proxies_pref =
416 profile()->GetPrefs()->FindPreference(prefs::kUseSharedProxies);
417 if (use_shared_proxies_pref->IsDefaultValue())
418 profile()->GetPrefs()->SetBoolean(prefs::kUseSharedProxies, false);
410 } 419 }
411 420
412 // Tests should be able to tune login manager before showing it. 421 // Tests should be able to tune login manager before showing it.
413 // Thus only show login manager in normal (non-testing) mode. 422 // Thus only show login manager in normal (non-testing) mode.
414 if (!parameters().ui_task) 423 if (!parameters().ui_task)
415 OptionallyRunChromeOSLoginManager(parsed_command_line(), profile()); 424 OptionallyRunChromeOSLoginManager(parsed_command_line(), profile());
416 425
417 ChromeBrowserMainPartsLinux::PostProfileInit(); 426 ChromeBrowserMainPartsLinux::PostProfileInit();
418 } 427 }
419 428
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell 520 // Let VideoPropertyWriter unregister itself as an observer of the ash::Shell
512 // singleton before the shell is destroyed. 521 // singleton before the shell is destroyed.
513 video_property_writer_.reset(); 522 video_property_writer_.reset();
514 // Remove PowerButtonObserver attached to a D-Bus client before 523 // Remove PowerButtonObserver attached to a D-Bus client before
515 // DBusThreadManager is shut down. 524 // DBusThreadManager is shut down.
516 power_button_observer_.reset(); 525 power_button_observer_.reset();
517 #endif 526 #endif
518 527
519 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun(); 528 ChromeBrowserMainPartsLinux::PostMainMessageLoopRun();
520 } 529 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698