| OLD | NEW |
| 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/extensions/extension_system.h" | 21 #include "chrome/browser/extensions/extension_system.h" |
| 22 #include "chrome/browser/managed_mode.h" | 22 #include "chrome/browser/managed_mode.h" |
| 23 #include "chrome/browser/prefs/pref_service.h" | 23 #include "chrome/browser/prefs/pref_service.h" |
| 24 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 24 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 25 #include "chrome/browser/profiles/profile_info_cache.h" | 25 #include "chrome/browser/profiles/profile_info_cache.h" |
| 26 #include "chrome/browser/profiles/profile_metrics.h" | 26 #include "chrome/browser/profiles/profile_metrics.h" |
| 27 #include "chrome/browser/sessions/session_service_factory.h" | 27 #include "chrome/browser/sessions/session_service_factory.h" |
| 28 #include "chrome/browser/sync/profile_sync_service.h" | 28 #include "chrome/browser/sync/profile_sync_service.h" |
| 29 #include "chrome/browser/sync/profile_sync_service_factory.h" | 29 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 30 #include "chrome/browser/ui/browser.h" | 30 #include "chrome/browser/ui/browser.h" |
| 31 #include "chrome/browser/ui/browser_finder.h" |
| 31 #include "chrome/browser/ui/browser_window.h" | 32 #include "chrome/browser/ui/browser_window.h" |
| 32 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 33 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
| 33 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" | 34 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" |
| 34 #include "chrome/common/chrome_constants.h" | 35 #include "chrome/common/chrome_constants.h" |
| 35 #include "chrome/common/chrome_notification_types.h" | 36 #include "chrome/common/chrome_notification_types.h" |
| 36 #include "chrome/common/chrome_paths_internal.h" | 37 #include "chrome/common/chrome_paths_internal.h" |
| 37 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
| 38 #include "chrome/common/logging_chrome.h" | 39 #include "chrome/common/logging_chrome.h" |
| 39 #include "chrome/common/pref_names.h" | 40 #include "chrome/common/pref_names.h" |
| 40 #include "chrome/common/url_constants.h" | 41 #include "chrome/common/url_constants.h" |
| 41 #if defined(OS_WIN) | |
| 42 #include "chrome/installer/util/browser_distribution.h" | |
| 43 #endif | |
| 44 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
| 45 #include "content/public/browser/notification_service.h" | 43 #include "content/public/browser/notification_service.h" |
| 46 #include "content/public/browser/user_metrics.h" | 44 #include "content/public/browser/user_metrics.h" |
| 47 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
| 48 #include "net/http/http_transaction_factory.h" | 46 #include "net/http/http_transaction_factory.h" |
| 49 #include "net/url_request/url_request_context.h" | 47 #include "net/url_request/url_request_context.h" |
| 50 #include "net/url_request/url_request_context_getter.h" | 48 #include "net/url_request/url_request_context_getter.h" |
| 51 #include "net/url_request/url_request_job.h" | 49 #include "net/url_request/url_request_job.h" |
| 52 #include "ui/base/l10n/l10n_util.h" | 50 #include "ui/base/l10n/l10n_util.h" |
| 53 | 51 |
| 52 #if defined(OS_WIN) |
| 53 #include "chrome/installer/util/browser_distribution.h" |
| 54 #endif |
| 55 |
| 54 #if defined(OS_CHROMEOS) | 56 #if defined(OS_CHROMEOS) |
| 55 #include "chrome/browser/chromeos/cros/cros_library.h" | 57 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 56 #include "chrome/browser/chromeos/cros/cryptohome_library.h" | 58 #include "chrome/browser/chromeos/cros/cryptohome_library.h" |
| 57 #include "chrome/browser/chromeos/login/user_manager.h" | 59 #include "chrome/browser/chromeos/login/user_manager.h" |
| 58 #endif | 60 #endif |
| 59 | 61 |
| 60 using content::BrowserThread; | 62 using content::BrowserThread; |
| 61 using content::UserMetricsAction; | 63 using content::UserMetricsAction; |
| 62 | 64 |
| 63 namespace { | 65 namespace { |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 471 |
| 470 // static | 472 // static |
| 471 void ProfileManager::FindOrCreateNewWindowForProfile( | 473 void ProfileManager::FindOrCreateNewWindowForProfile( |
| 472 Profile* profile, | 474 Profile* profile, |
| 473 browser::startup::IsProcessStartup process_startup, | 475 browser::startup::IsProcessStartup process_startup, |
| 474 browser::startup::IsFirstRun is_first_run, | 476 browser::startup::IsFirstRun is_first_run, |
| 475 bool always_create) { | 477 bool always_create) { |
| 476 DCHECK(profile); | 478 DCHECK(profile); |
| 477 | 479 |
| 478 if (!always_create) { | 480 if (!always_create) { |
| 479 Browser* browser = BrowserList::FindTabbedBrowser(profile, false); | 481 Browser* browser = browser::FindTabbedBrowser(profile, false); |
| 480 if (browser) { | 482 if (browser) { |
| 481 browser->window()->Activate(); | 483 browser->window()->Activate(); |
| 482 return; | 484 return; |
| 483 } | 485 } |
| 484 } | 486 } |
| 485 | 487 |
| 486 content::RecordAction(UserMetricsAction("NewWindow")); | 488 content::RecordAction(UserMetricsAction("NewWindow")); |
| 487 CommandLine command_line(CommandLine::NO_PROGRAM); | 489 CommandLine command_line(CommandLine::NO_PROGRAM); |
| 488 int return_code; | 490 int return_code; |
| 489 StartupBrowserCreator browser_creator; | 491 StartupBrowserCreator browser_creator; |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 AddProfileToCache(profile); | 969 AddProfileToCache(profile); |
| 968 } | 970 } |
| 969 } | 971 } |
| 970 | 972 |
| 971 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, | 973 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, |
| 972 Profile* profile, | 974 Profile* profile, |
| 973 Profile::CreateStatus status) { | 975 Profile::CreateStatus status) { |
| 974 for (size_t i = 0; i < callbacks.size(); ++i) | 976 for (size_t i = 0; i < callbacks.size(); ++i) |
| 975 callbacks[i].Run(profile, status); | 977 callbacks[i].Run(profile, status); |
| 976 } | 978 } |
| OLD | NEW |