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 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 #include "chrome/browser/search_engines/template_url_service_factory.h" | 75 #include "chrome/browser/search_engines/template_url_service_factory.h" |
76 #include "chrome/browser/search_engines/template_url_service.h" | 76 #include "chrome/browser/search_engines/template_url_service.h" |
77 #include "chrome/browser/service/service_process_control.h" | 77 #include "chrome/browser/service/service_process_control.h" |
78 #include "chrome/browser/shell_integration.h" | 78 #include "chrome/browser/shell_integration.h" |
79 #include "chrome/browser/translate/translate_manager.h" | 79 #include "chrome/browser/translate/translate_manager.h" |
80 #include "chrome/browser/ui/browser.h" | 80 #include "chrome/browser/ui/browser.h" |
81 #include "chrome/browser/ui/browser_init.h" | 81 #include "chrome/browser/ui/browser_init.h" |
82 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" | 82 #include "chrome/browser/ui/webui/chrome_url_data_manager_backend.h" |
83 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 83 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
84 #include "chrome/browser/ui/webui/sync_promo/sync_promo_trial.h" | 84 #include "chrome/browser/ui/webui/sync_promo/sync_promo_trial.h" |
85 #include "chrome/common/app_mode.h" | |
85 #include "chrome/common/child_process_logging.h" | 86 #include "chrome/common/child_process_logging.h" |
86 #include "chrome/common/chrome_constants.h" | 87 #include "chrome/common/chrome_constants.h" |
87 #include "chrome/common/chrome_paths.h" | 88 #include "chrome/common/chrome_paths.h" |
88 #include "chrome/common/chrome_result_codes.h" | 89 #include "chrome/common/chrome_result_codes.h" |
89 #include "chrome/common/chrome_switches.h" | 90 #include "chrome/common/chrome_switches.h" |
90 #include "chrome/common/chrome_version_info.h" | 91 #include "chrome/common/chrome_version_info.h" |
91 #include "chrome/common/env_vars.h" | 92 #include "chrome/common/env_vars.h" |
92 #include "chrome/common/json_pref_store.h" | 93 #include "chrome/common/json_pref_store.h" |
93 #include "chrome/common/jstemplate_builder.h" | 94 #include "chrome/common/jstemplate_builder.h" |
94 #include "chrome/common/logging_chrome.h" | 95 #include "chrome/common/logging_chrome.h" |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1265 // is initialized. | 1266 // is initialized. |
1266 first_run_ui_bypass_ = false; // True to skip first run UI. | 1267 first_run_ui_bypass_ = false; // True to skip first run UI. |
1267 if (is_first_run_) { | 1268 if (is_first_run_) { |
1268 first_run_ui_bypass_ = !first_run::ProcessMasterPreferences( | 1269 first_run_ui_bypass_ = !first_run::ProcessMasterPreferences( |
1269 user_data_dir_, master_prefs_.get()); | 1270 user_data_dir_, master_prefs_.get()); |
1270 AddFirstRunNewTabs(browser_init_.get(), master_prefs_->new_tabs); | 1271 AddFirstRunNewTabs(browser_init_.get(), master_prefs_->new_tabs); |
1271 | 1272 |
1272 // If we are running in App mode, we do not want to show the importer | 1273 // If we are running in App mode, we do not want to show the importer |
1273 // (first run) UI. | 1274 // (first run) UI. |
1274 if (!first_run_ui_bypass_ && | 1275 if (!first_run_ui_bypass_ && |
1275 (parsed_command_line().HasSwitch(switches::kApp) || | 1276 (app_mode::IsRunningInAppMode() || |
sail
2012/03/06 19:26:35
could we just add a kNoFirstRun to the CommandLine
| |
1276 parsed_command_line().HasSwitch(switches::kAppId) || | |
1277 parsed_command_line().HasSwitch(switches::kNoFirstRun))) | 1277 parsed_command_line().HasSwitch(switches::kNoFirstRun))) |
1278 first_run_ui_bypass_ = true; | 1278 first_run_ui_bypass_ = true; |
1279 | 1279 |
1280 // Create Sentinel if no-first-run argument is passed in. | 1280 // Create Sentinel if no-first-run argument is passed in. |
1281 if (parsed_command_line().HasSwitch(switches::kNoFirstRun)) | 1281 if (parsed_command_line().HasSwitch(switches::kNoFirstRun)) |
1282 first_run::CreateSentinel(); | 1282 first_run::CreateSentinel(); |
1283 } | 1283 } |
1284 | 1284 |
1285 // TODO(viettrungluu): why don't we run this earlier? | 1285 // TODO(viettrungluu): why don't we run this earlier? |
1286 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs)) | 1286 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs)) |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2007 if (base::win::GetVersion() <= base::win::VERSION_XP) | 2007 if (base::win::GetVersion() <= base::win::VERSION_XP) |
2008 uma_name += "_XP"; | 2008 uma_name += "_XP"; |
2009 | 2009 |
2010 uma_name += "_PreRead_"; | 2010 uma_name += "_PreRead_"; |
2011 uma_name += pre_read_percentage; | 2011 uma_name += pre_read_percentage; |
2012 AddPreReadHistogramTime(uma_name.c_str(), time); | 2012 AddPreReadHistogramTime(uma_name.c_str(), time); |
2013 } | 2013 } |
2014 #endif | 2014 #endif |
2015 #endif | 2015 #endif |
2016 } | 2016 } |
OLD | NEW |