Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 11413121: Move Windows-specific first run task out of chrome_browser_main.cc by introducing first_run::DoFirs… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comment + TODO(thakis) Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chrome_browser_main_win.h ('k') | chrome/browser/first_run/first_run_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main_win.cc
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc
index 10ed28d3807543761ded08f6d77fd3101b70667a..fc095fe36006045bae7601bf18d260b63587fe9c 100644
--- a/chrome/browser/chrome_browser_main_win.cc
+++ b/chrome/browser/chrome_browser_main_win.cc
@@ -11,11 +11,14 @@
#include "base/command_line.h"
#include "base/environment.h"
+#include "base/file_path.h"
#include "base/i18n/rtl.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
#include "base/scoped_native_library.h"
#include "base/string_number_conversions.h"
+#include "base/threading/sequenced_worker_pool.h"
+#include "base/time.h"
#include "base/utf_string_conversions.h"
#include "base/win/metro.h"
#include "base/win/text_services_message_filter.h"
@@ -39,6 +42,7 @@
#include "chrome/installer/util/install_util.h"
#include "chrome/installer/util/l10n_string_util.h"
#include "chrome/installer/util/shell_util.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/common/main_function_params.h"
#include "grit/app_locale_settings.h"
#include "grit/chromium_strings.h"
@@ -245,6 +249,32 @@ void ChromeBrowserMainPartsWin::PreMainMessageLoopRun() {
#endif
}
+void ChromeBrowserMainPartsWin::PreInteractiveFirstRunInit() {
+ // Trigger the Active Setup command for system-level Chromes to finish
+ // configuring this user's install (e.g. per-user shortcuts).
+ // Delay the task slightly to give Chrome launch I/O priority while also
+ // making sure shortcuts are created promptly to avoid annoying the user by
+ // re-creating shortcuts he previously deleted.
+ static const int64 kTiggerActiveSetupDelaySeconds = 5;
+ FilePath chrome_exe;
+ if (!PathService::Get(base::FILE_EXE, &chrome_exe)) {
+ NOTREACHED();
+ } else if (!InstallUtil::IsPerUserInstall(chrome_exe.value().c_str())) {
+ content::BrowserThread::GetBlockingPool()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&InstallUtil::TriggerActiveSetupCommand),
+ base::TimeDelta::FromSeconds(kTiggerActiveSetupDelaySeconds));
+ }
+
+ ChromeBrowserMainParts::PreInteractiveFirstRunInit();
+}
+
+void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() {
+ ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage),
+ ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle),
+ MB_OK | MB_ICONERROR | MB_TOPMOST);
+}
+
// static
void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment(
const CommandLine& parsed_command_line) {
@@ -314,12 +344,6 @@ void ChromeBrowserMainPartsWin::RegisterApplicationRestart(
}
}
-void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() {
- ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage),
- ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle),
- MB_OK | MB_ICONERROR | MB_TOPMOST);
-}
-
// static
int ChromeBrowserMainPartsWin::HandleIconsCommands(
const CommandLine& parsed_command_line) {
« no previous file with comments | « chrome/browser/chrome_browser_main_win.h ('k') | chrome/browser/first_run/first_run_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698