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) | |
8 #include <gtk/gtk.h> | |
9 #endif | |
10 | |
11 #include <set> | 7 #include <set> |
12 #include <string> | 8 #include <string> |
13 #include <vector> | 9 #include <vector> |
14 | 10 |
15 #include "base/at_exit.h" | 11 #include "base/at_exit.h" |
16 #include "base/bind.h" | 12 #include "base/bind.h" |
17 #include "base/command_line.h" | 13 #include "base/command_line.h" |
18 #include "base/debug/crash_logging.h" | 14 #include "base/debug/crash_logging.h" |
19 #include "base/debug/debugger.h" | 15 #include "base/debug/debugger.h" |
20 #include "base/debug/trace_event.h" | 16 #include "base/debug/trace_event.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 } // namespace | 509 } // namespace |
514 | 510 |
515 namespace chrome_browser { | 511 namespace chrome_browser { |
516 | 512 |
517 // This error message is not localized because we failed to load the | 513 // This error message is not localized because we failed to load the |
518 // localization data files. | 514 // localization data files. |
519 #if defined(OS_WIN) | 515 #if defined(OS_WIN) |
520 const char kMissingLocaleDataTitle[] = "Missing File Error"; | 516 const char kMissingLocaleDataTitle[] = "Missing File Error"; |
521 #endif | 517 #endif |
522 | 518 |
523 #if defined(OS_WIN) || defined(TOOLKIT_GTK) | 519 #if defined(OS_WIN) |
524 // TODO(port) This should be used on Linux Aura as well. http://crbug.com/338969 | 520 // TODO(port) This should be used on Linux Aura as well. http://crbug.com/338969 |
525 const char kMissingLocaleDataMessage[] = | 521 const char kMissingLocaleDataMessage[] = |
526 "Unable to find locale data files. Please reinstall."; | 522 "Unable to find locale data files. Please reinstall."; |
527 #endif | 523 #endif |
528 | 524 |
529 } // namespace chrome_browser | 525 } // namespace chrome_browser |
530 | 526 |
531 // BrowserMainParts ------------------------------------------------------------ | 527 // BrowserMainParts ------------------------------------------------------------ |
532 | 528 |
533 // static | 529 // static |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 base::FilePath resources_pack_path; | 905 base::FilePath resources_pack_path; |
910 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); | 906 PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path); |
911 { | 907 { |
912 TRACE_EVENT0("startup", | 908 TRACE_EVENT0("startup", |
913 "ChromeBrowserMainParts::PreCreateThreadsImpl:AddDataPack"); | 909 "ChromeBrowserMainParts::PreCreateThreadsImpl:AddDataPack"); |
914 ResourceBundle::GetSharedInstance().AddDataPackFromPath( | 910 ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
915 resources_pack_path, ui::SCALE_FACTOR_NONE); | 911 resources_pack_path, ui::SCALE_FACTOR_NONE); |
916 } | 912 } |
917 #endif // defined(OS_MACOSX) | 913 #endif // defined(OS_MACOSX) |
918 | 914 |
919 #if defined(TOOLKIT_GTK) | |
920 g_set_application_name(l10n_util::GetStringUTF8(IDS_PRODUCT_NAME).c_str()); | |
921 #endif | |
922 | |
923 // Android does first run in Java instead of native. | 915 // Android does first run in Java instead of native. |
924 // Chrome OS has its own out-of-box-experience code. | 916 // Chrome OS has its own out-of-box-experience code. |
925 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 917 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
926 // On first run, we need to process the predictor preferences before the | 918 // On first run, we need to process the predictor preferences before the |
927 // browser's profile_manager object is created, but after ResourceBundle | 919 // browser's profile_manager object is created, but after ResourceBundle |
928 // is initialized. | 920 // is initialized. |
929 if (first_run::IsChromeFirstRun()) { | 921 if (first_run::IsChromeFirstRun()) { |
930 first_run::ProcessMasterPreferencesResult pmp_result = | 922 first_run::ProcessMasterPreferencesResult pmp_result = |
931 first_run::ProcessMasterPreferences(user_data_dir_, | 923 first_run::ProcessMasterPreferences(user_data_dir_, |
932 master_prefs_.get()); | 924 master_prefs_.get()); |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1712 chromeos::CrosSettings::Shutdown(); | 1704 chromeos::CrosSettings::Shutdown(); |
1713 #endif | 1705 #endif |
1714 #endif | 1706 #endif |
1715 } | 1707 } |
1716 | 1708 |
1717 // Public members: | 1709 // Public members: |
1718 | 1710 |
1719 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1711 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1720 chrome_extra_parts_.push_back(parts); | 1712 chrome_extra_parts_.push_back(parts); |
1721 } | 1713 } |
OLD | NEW |