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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 9117024: Changes to "launch with multiple profiles" behavior. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review. Created 8 years, 11 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 | chrome/browser/ui/browser_init.cc » ('j') | 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/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 #include "chrome/browser/metrics/tracking_synchronizer.h" 54 #include "chrome/browser/metrics/tracking_synchronizer.h"
55 #include "chrome/browser/nacl_host/nacl_process_host.h" 55 #include "chrome/browser/nacl_host/nacl_process_host.h"
56 #include "chrome/browser/net/chrome_net_log.h" 56 #include "chrome/browser/net/chrome_net_log.h"
57 #include "chrome/browser/net/predictor.h" 57 #include "chrome/browser/net/predictor.h"
58 #include "chrome/browser/notifications/desktop_notification_service.h" 58 #include "chrome/browser/notifications/desktop_notification_service.h"
59 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 59 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
60 #include "chrome/browser/plugin_prefs.h" 60 #include "chrome/browser/plugin_prefs.h"
61 #include "chrome/browser/policy/browser_policy_connector.h" 61 #include "chrome/browser/policy/browser_policy_connector.h"
62 #include "chrome/browser/prefs/pref_service.h" 62 #include "chrome/browser/prefs/pref_service.h"
63 #include "chrome/browser/prefs/pref_value_store.h" 63 #include "chrome/browser/prefs/pref_value_store.h"
64 #include "chrome/browser/prefs/scoped_user_pref_update.h"
64 #include "chrome/browser/prerender/prerender_field_trial.h" 65 #include "chrome/browser/prerender/prerender_field_trial.h"
65 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" 66 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h"
66 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" 67 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h"
67 #include "chrome/browser/process_singleton.h" 68 #include "chrome/browser/process_singleton.h"
68 #include "chrome/browser/profiles/profile.h" 69 #include "chrome/browser/profiles/profile.h"
69 #include "chrome/browser/profiles/profile_manager.h" 70 #include "chrome/browser/profiles/profile_manager.h"
70 #include "chrome/browser/search_engines/search_engine_type.h" 71 #include "chrome/browser/search_engines/search_engine_type.h"
71 #include "chrome/browser/search_engines/template_url.h" 72 #include "chrome/browser/search_engines/template_url.h"
72 #include "chrome/browser/search_engines/template_url_service.h" 73 #include "chrome/browser/search_engines/template_url_service.h"
73 #include "chrome/browser/search_engines/template_url_service_factory.h" 74 #include "chrome/browser/search_engines/template_url_service_factory.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 // should not continue. 386 // should not continue.
386 Profile* CreateProfile(const content::MainFunctionParams& parameters, 387 Profile* CreateProfile(const content::MainFunctionParams& parameters,
387 const FilePath& user_data_dir, 388 const FilePath& user_data_dir,
388 const CommandLine& parsed_command_line) { 389 const CommandLine& parsed_command_line) {
389 Profile* profile; 390 Profile* profile;
390 if (ProfileManager::IsMultipleProfilesEnabled() && 391 if (ProfileManager::IsMultipleProfilesEnabled() &&
391 parsed_command_line.HasSwitch(switches::kProfileDirectory)) { 392 parsed_command_line.HasSwitch(switches::kProfileDirectory)) {
392 g_browser_process->local_state()->SetString(prefs::kProfileLastUsed, 393 g_browser_process->local_state()->SetString(prefs::kProfileLastUsed,
393 parsed_command_line.GetSwitchValueASCII( 394 parsed_command_line.GetSwitchValueASCII(
394 switches::kProfileDirectory)); 395 switches::kProfileDirectory));
396 // Clear kProfilesLastActive since the user only wants to launch a specific
397 // profile.
398 ListPrefUpdate update(g_browser_process->local_state(),
399 prefs::kProfilesLastActive);
400 ListValue* profile_list = update.Get();
401 profile_list->Clear();
395 } 402 }
396 #if defined(OS_CHROMEOS) 403 #if defined(OS_CHROMEOS)
397 // TODO(ivankr): http://crbug.com/83792 404 // TODO(ivankr): http://crbug.com/83792
398 profile = g_browser_process->profile_manager()->GetDefaultProfile( 405 profile = g_browser_process->profile_manager()->GetDefaultProfile(
399 user_data_dir); 406 user_data_dir);
400 #else 407 #else
401 profile = g_browser_process->profile_manager()->GetLastUsedProfile( 408 profile = g_browser_process->profile_manager()->GetLastUsedProfile(
402 user_data_dir); 409 user_data_dir);
403 #endif 410 #endif
404 if (profile) 411 if (profile)
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after
1953 if (base::win::GetVersion() <= base::win::VERSION_XP) 1960 if (base::win::GetVersion() <= base::win::VERSION_XP)
1954 uma_name += "_XP"; 1961 uma_name += "_XP";
1955 1962
1956 uma_name += "_PreRead"; 1963 uma_name += "_PreRead";
1957 uma_name += pre_read == "1" ? "Enabled" : "Disabled"; 1964 uma_name += pre_read == "1" ? "Enabled" : "Disabled";
1958 AddPreReadHistogramTime(uma_name.c_str(), time); 1965 AddPreReadHistogramTime(uma_name.c_str(), time);
1959 } 1966 }
1960 #endif 1967 #endif
1961 #endif 1968 #endif
1962 } 1969 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/browser_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698