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_win.h" | 5 #include "chrome/browser/chrome_browser_main_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/environment.h" | 13 #include "base/environment.h" |
14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
15 #include "base/i18n/rtl.h" | 15 #include "base/i18n/rtl.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
17 #include "base/path_service.h" | 17 #include "base/path_service.h" |
18 #include "base/scoped_native_library.h" | 18 #include "base/scoped_native_library.h" |
19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
20 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
21 #include "base/win/metro.h" | 21 #include "base/win/metro.h" |
22 #include "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
23 #include "base/win/wrapped_window_proc.h" | 23 #include "base/win/wrapped_window_proc.h" |
24 #include "chrome/browser/browser_util_win.h" | 24 #include "chrome/browser/browser_util_win.h" |
25 #include "chrome/browser/first_run/first_run.h" | 25 #include "chrome/browser/first_run/first_run.h" |
26 #include "chrome/browser/metrics/metrics_service.h" | 26 #include "chrome/browser/metrics/metrics_service.h" |
27 #include "chrome/browser/profiles/profile_info_cache.h" | 27 #include "chrome/browser/profiles/profile_info_cache.h" |
28 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 28 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
29 #include "chrome/browser/shell_integration.h" | 29 #include "chrome/browser/shell_integration.h" |
30 #include "chrome/browser/storage_monitor/storage_monitor_win.h" | |
31 #include "chrome/browser/search_engines/template_url.h" | 30 #include "chrome/browser/search_engines/template_url.h" |
32 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" | 31 #include "chrome/browser/search_engines/template_url_prepopulate_data.h" |
33 #include "chrome/browser/search_engines/template_url_service.h" | 32 #include "chrome/browser/search_engines/template_url_service.h" |
34 #include "chrome/browser/search_engines/template_url_service_factory.h" | 33 #include "chrome/browser/search_engines/template_url_service_factory.h" |
35 #include "chrome/browser/ui/simple_message_box.h" | 34 #include "chrome/browser/ui/simple_message_box.h" |
36 #include "chrome/browser/ui/uninstall_browser_prompt.h" | 35 #include "chrome/browser/ui/uninstall_browser_prompt.h" |
37 #include "chrome/common/chrome_constants.h" | 36 #include "chrome/common/chrome_constants.h" |
38 #include "chrome/common/chrome_result_codes.h" | 37 #include "chrome/common/chrome_result_codes.h" |
39 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
40 #include "chrome/common/env_vars.h" | 39 #include "chrome/common/env_vars.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 TemplateURLPrepopulateData::GetEngineType(default_search_engine ? | 220 TemplateURLPrepopulateData::GetEngineType(default_search_engine ? |
222 default_search_engine->url() : std::string()); | 221 default_search_engine->url() : std::string()); |
223 // Record the search engine chosen. | 222 // Record the search engine chosen. |
224 UMA_HISTOGRAM_ENUMERATION("Chrome.SearchSelectExempt", search_engine_type, | 223 UMA_HISTOGRAM_ENUMERATION("Chrome.SearchSelectExempt", search_engine_type, |
225 SEARCH_ENGINE_MAX); | 224 SEARCH_ENGINE_MAX); |
226 } | 225 } |
227 | 226 |
228 ChromeBrowserMainParts::PostMainMessageLoopRun(); | 227 ChromeBrowserMainParts::PostMainMessageLoopRun(); |
229 } | 228 } |
230 | 229 |
231 void ChromeBrowserMainPartsWin::PreProfileInit() { | |
232 storage_monitor_.reset(chrome::StorageMonitorWin::Create()); | |
233 | |
234 ChromeBrowserMainParts::PreProfileInit(); | |
235 } | |
236 | |
237 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() { | 230 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() { |
238 ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage), | 231 ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage), |
239 ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle), | 232 ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle), |
240 MB_OK | MB_ICONERROR | MB_TOPMOST); | 233 MB_OK | MB_ICONERROR | MB_TOPMOST); |
241 } | 234 } |
242 | 235 |
243 // static | 236 // static |
244 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( | 237 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( |
245 const CommandLine& parsed_command_line) { | 238 const CommandLine& parsed_command_line) { |
246 // Clear this var so child processes don't show the dialog by default. | 239 // Clear this var so child processes don't show the dialog by default. |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 if (resource_id) | 402 if (resource_id) |
410 return l10n_util::GetStringUTF16(resource_id); | 403 return l10n_util::GetStringUTF16(resource_id); |
411 return string16(); | 404 return string16(); |
412 } | 405 } |
413 | 406 |
414 // static | 407 // static |
415 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 408 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
416 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 409 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
417 installer::SetTranslationDelegate(&delegate); | 410 installer::SetTranslationDelegate(&delegate); |
418 } | 411 } |
OLD | NEW |