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

Side by Side Diff: chrome/browser/chrome_browser_main_win.cc

Issue 12647013: Regularize storage monitor creation in Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 7 years, 8 months 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 unified diff | Download patch
OLDNEW
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>
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 void ChromeBrowserMainPartsWin::PreMainMessageLoopStart() { 192 void ChromeBrowserMainPartsWin::PreMainMessageLoopStart() {
193 // installer_util references strings that are normally compiled into 193 // installer_util references strings that are normally compiled into
194 // setup.exe. In Chrome, these strings are in the locale files. 194 // setup.exe. In Chrome, these strings are in the locale files.
195 SetupInstallerUtilStrings(); 195 SetupInstallerUtilStrings();
196 196
197 ChromeBrowserMainParts::PreMainMessageLoopStart(); 197 ChromeBrowserMainParts::PreMainMessageLoopStart();
198 if (!parameters().ui_task) { 198 if (!parameters().ui_task) {
199 // Make sure that we know how to handle exceptions from the message loop. 199 // Make sure that we know how to handle exceptions from the message loop.
200 InitializeWindowProcExceptions(); 200 InitializeWindowProcExceptions();
201 } 201 }
202 storage_monitor_.reset(chrome::StorageMonitorWin::Create());
203 } 202 }
204 203
205 void ChromeBrowserMainPartsWin::PostMainMessageLoopStart() { 204 void ChromeBrowserMainPartsWin::PostMainMessageLoopStart() {
206 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); 205 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type());
207 206
208 if (base::win::IsTSFAwareRequired()) { 207 if (base::win::IsTSFAwareRequired()) {
209 // Create a TSF message filter for the message loop. MessageLoop takes 208 // Create a TSF message filter for the message loop. MessageLoop takes
210 // ownership of the filter. 209 // ownership of the filter.
211 scoped_ptr<base::win::TextServicesMessageFilter> tsf_message_filter( 210 scoped_ptr<base::win::TextServicesMessageFilter> tsf_message_filter(
212 new base::win::TextServicesMessageFilter); 211 new base::win::TextServicesMessageFilter);
213 if (tsf_message_filter->Init()) { 212 if (tsf_message_filter->Init()) {
214 MessageLoopForUI::current()->SetMessageFilter( 213 MessageLoopForUI::current()->SetMessageFilter(
215 tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>()); 214 tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>());
216 } 215 }
217 } 216 }
218 } 217 }
219 218
220 void ChromeBrowserMainPartsWin::PreMainMessageLoopRun() { 219 void ChromeBrowserMainPartsWin::PreProfileInit() {
221 ChromeBrowserMainParts::PreMainMessageLoopRun(); 220 storage_monitor_.reset(chrome::StorageMonitorWin::Create());
222 221
222 ChromeBrowserMainParts::PreProfileInit();
223 }
224
225 void ChromeBrowserMainPartsWin::PostProfileInit() {
223 storage_monitor_->Init(); 226 storage_monitor_->Init();
227
228 ChromeBrowserMainParts::PostProfileInit();
224 } 229 }
225 230
226 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() { 231 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() {
227 ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage), 232 ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage),
228 ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle), 233 ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle),
229 MB_OK | MB_ICONERROR | MB_TOPMOST); 234 MB_OK | MB_ICONERROR | MB_TOPMOST);
230 } 235 }
231 236
232 // static 237 // static
233 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( 238 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment(
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 if (resource_id) 403 if (resource_id)
399 return l10n_util::GetStringUTF16(resource_id); 404 return l10n_util::GetStringUTF16(resource_id);
400 return string16(); 405 return string16();
401 } 406 }
402 407
403 // static 408 // static
404 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { 409 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() {
405 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); 410 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ());
406 installer::SetTranslationDelegate(&delegate); 411 installer::SetTranslationDelegate(&delegate);
407 } 412 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main_win.h ('k') | chrome/browser/storage_monitor/volume_mount_watcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698