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 "chrome/browser/chrome_browser_main.h" | 5 #include "chrome/browser/chrome_browser_main.h" |
6 | 6 |
7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 #include "chrome/browser/three_d_api_observer.h" | 93 #include "chrome/browser/three_d_api_observer.h" |
94 #include "chrome/browser/translate/translate_service.h" | 94 #include "chrome/browser/translate/translate_service.h" |
95 #include "chrome/browser/ui/app_list/app_list_service.h" | 95 #include "chrome/browser/ui/app_list/app_list_service.h" |
96 #include "chrome/browser/ui/browser.h" | 96 #include "chrome/browser/ui/browser.h" |
97 #include "chrome/browser/ui/browser_finder.h" | 97 #include "chrome/browser/ui/browser_finder.h" |
98 #include "chrome/browser/ui/host_desktop.h" | 98 #include "chrome/browser/ui/host_desktop.h" |
99 #include "chrome/browser/ui/startup/default_browser_prompt.h" | 99 #include "chrome/browser/ui/startup/default_browser_prompt.h" |
100 #include "chrome/browser/ui/startup/startup_browser_creator.h" | 100 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
101 #include "chrome/browser/ui/uma_browsing_activity_observer.h" | 101 #include "chrome/browser/ui/uma_browsing_activity_observer.h" |
102 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 102 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
103 #include "chrome/browser/user_data_dir_extractor.h" | |
104 #include "chrome/common/chrome_constants.h" | 103 #include "chrome/common/chrome_constants.h" |
105 #include "chrome/common/chrome_paths.h" | 104 #include "chrome/common/chrome_paths.h" |
106 #include "chrome/common/chrome_result_codes.h" | 105 #include "chrome/common/chrome_result_codes.h" |
107 #include "chrome/common/chrome_switches.h" | 106 #include "chrome/common/chrome_switches.h" |
108 #include "chrome/common/crash_keys.h" | 107 #include "chrome/common/crash_keys.h" |
109 #include "chrome/common/env_vars.h" | 108 #include "chrome/common/env_vars.h" |
110 #include "chrome/common/logging_chrome.h" | 109 #include "chrome/common/logging_chrome.h" |
111 #include "chrome/common/net/net_resource_provider.h" | 110 #include "chrome/common/net/net_resource_provider.h" |
112 #include "chrome/common/pref_names.h" | 111 #include "chrome/common/pref_names.h" |
113 #include "chrome/common/profile_management_switches.h" | 112 #include "chrome/common/profile_management_switches.h" |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) | 777 for (size_t i = 0; i < chrome_extra_parts_.size(); ++i) |
779 chrome_extra_parts_[i]->PreCreateThreads(); | 778 chrome_extra_parts_[i]->PreCreateThreads(); |
780 } | 779 } |
781 | 780 |
782 return result_code_; | 781 return result_code_; |
783 } | 782 } |
784 | 783 |
785 int ChromeBrowserMainParts::PreCreateThreadsImpl() { | 784 int ChromeBrowserMainParts::PreCreateThreadsImpl() { |
786 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsImpl") | 785 TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreCreateThreadsImpl") |
787 run_message_loop_ = false; | 786 run_message_loop_ = false; |
788 { | 787 CHECK(PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_)); |
789 TRACE_EVENT0("startup", | |
790 "ChromeBrowserMainParts::PreCreateThreadsImpl:GetUserDataDir"); | |
791 user_data_dir_ = chrome::GetUserDataDir(parameters()); | |
792 } | |
793 | 788 |
794 // Force MediaCaptureDevicesDispatcher to be created on UI thread. | 789 // Force MediaCaptureDevicesDispatcher to be created on UI thread. |
795 MediaCaptureDevicesDispatcher::GetInstance(); | 790 MediaCaptureDevicesDispatcher::GetInstance(); |
796 | 791 |
797 // Android's first run is done in Java instead of native. | 792 // Android's first run is done in Java instead of native. |
798 #if !defined(OS_ANDROID) | 793 #if !defined(OS_ANDROID) |
799 process_singleton_.reset(new ChromeProcessSingleton( | 794 process_singleton_.reset(new ChromeProcessSingleton( |
800 user_data_dir_, base::Bind(&ProcessSingletonNotificationCallback))); | 795 user_data_dir_, base::Bind(&ProcessSingletonNotificationCallback))); |
801 | 796 |
802 // Cache first run state early. | 797 // Cache first run state early. |
(...skipping 890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 chromeos::CrosSettings::Shutdown(); | 1688 chromeos::CrosSettings::Shutdown(); |
1694 #endif | 1689 #endif |
1695 #endif | 1690 #endif |
1696 } | 1691 } |
1697 | 1692 |
1698 // Public members: | 1693 // Public members: |
1699 | 1694 |
1700 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1695 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1701 chrome_extra_parts_.push_back(parts); | 1696 chrome_extra_parts_.push_back(parts); |
1702 } | 1697 } |
OLD | NEW |