summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chrome_browser_main_win.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-10 18:00:51 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-10 18:00:51 +0000
commite8b6ca09daa38e93c9f613c99a90e295ed3511ae (patch)
tree928c23584998f720ce1639b822e3c5622b7e8c37 /chrome/browser/chrome_browser_main_win.cc
parentf5f534be197fb1cfa2fb0e719e38a8cdb18a6c41 (diff)
downloadchromium_src-e8b6ca09daa38e93c9f613c99a90e295ed3511ae.zip
chromium_src-e8b6ca09daa38e93c9f613c99a90e295ed3511ae.tar.gz
chromium_src-e8b6ca09daa38e93c9f613c99a90e295ed3511ae.tar.bz2
Small cleanup for ChromeBrowserMain:
-add ChromeBrowserMainExtraPartsX11 to get rid of the x11 specific calls in ChromeBrowserMain that are right beside ChromeBrowserMainExtraParts calls -move win specific stuff out of ChromeBrowserMain and into ChromeBrowserMainWin -remove the static methods in chrome_browser_main.h in favor of private methods in chrome_browser_main.h -remove the unnecessary toolkit_extra_parts.h header, it doesn't help much since each method was named differently anyways R=thakis@chromium.org Review URL: https://codereview.chromium.org/18967002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210884 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_browser_main_win.cc')
-rw-r--r--chrome/browser/chrome_browser_main_win.cc51
1 files changed, 38 insertions, 13 deletions
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index 6149cf9..07862a5 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -28,6 +28,10 @@
#include "chrome/browser/profiles/profile_shortcut_manager.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/storage_monitor/storage_monitor_win.h"
+#include "chrome/browser/search_engines/template_url.h"
+#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
+#include "chrome/browser/search_engines/template_url_service.h"
+#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/ui/simple_message_box.h"
#include "chrome/browser/ui/uninstall_browser_prompt.h"
#include "chrome/common/chrome_constants.h"
@@ -88,19 +92,6 @@ class TranslationDelegate : public installer::TranslationDelegate {
} // namespace
-void RecordBreakpadStatusUMA(MetricsService* metrics) {
- metrics->RecordBreakpadHasDebugger(TRUE == ::IsDebuggerPresent());
-}
-
-void WarnAboutMinimumSystemRequirements() {
- if (base::win::GetVersion() < base::win::VERSION_XP) {
- chrome::ShowMessageBox(NULL,
- l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
- l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP),
- chrome::MESSAGE_BOX_TYPE_WARNING);
- }
-}
-
void ShowCloseBrowserFirstMessageBox() {
int message_id = IDS_UNINSTALL_CLOSE_APP;
if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
@@ -203,6 +194,40 @@ void ChromeBrowserMainPartsWin::PreMainMessageLoopStart() {
}
}
+int ChromeBrowserMainPartsWin::PreCreateThreads() {
+ // TODO(viettrungluu): why don't we run this earlier?
+ if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) &&
+ base::win::GetVersion() < base::win::VERSION_XP) {
+ chrome::ShowMessageBox(NULL,
+ l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
+ l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP),
+ chrome::MESSAGE_BOX_TYPE_WARNING);
+ }
+
+ return ChromeBrowserMainParts::PreCreateThreads();
+}
+
+void ChromeBrowserMainPartsWin::PostMainMessageLoopRun() {
+ // Log the search engine chosen on first run. Do this at shutdown, after any
+ // changes are made from the first run bubble link, etc.
+ if (do_first_run_tasks() && !profile()->IsOffTheRecord()) {
+ TemplateURLService* url_service =
+ TemplateURLServiceFactory::GetForProfile(profile());
+ const TemplateURL* default_search_engine =
+ url_service->GetDefaultSearchProvider();
+ // The default engine can be NULL if the administrator has disabled
+ // default search.
+ SearchEngineType search_engine_type =
+ TemplateURLPrepopulateData::GetEngineType(default_search_engine ?
+ default_search_engine->url() : std::string());
+ // Record the search engine chosen.
+ UMA_HISTOGRAM_ENUMERATION("Chrome.SearchSelectExempt", search_engine_type,
+ SEARCH_ENGINE_MAX);
+ }
+
+ ChromeBrowserMainParts::PostMainMessageLoopRun();
+}
+
void ChromeBrowserMainPartsWin::PreProfileInit() {
storage_monitor_.reset(chrome::StorageMonitorWin::Create());