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> |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 removable_device_notifications_window_.reset( | |
203 chrome::RemovableDeviceNotificationsWindowWin::Create()); | |
204 } | 202 } |
205 | 203 |
206 void ChromeBrowserMainPartsWin::PostMainMessageLoopStart() { | 204 void ChromeBrowserMainPartsWin::PostMainMessageLoopStart() { |
207 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); | 205 DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); |
208 | 206 |
209 if (base::win::IsTSFAwareRequired()) { | 207 if (base::win::IsTSFAwareRequired()) { |
210 // Create a TSF message filter for the message loop. MessageLoop takes | 208 // Create a TSF message filter for the message loop. MessageLoop takes |
211 // ownership of the filter. | 209 // ownership of the filter. |
212 scoped_ptr<base::win::TextServicesMessageFilter> tsf_message_filter( | 210 scoped_ptr<base::win::TextServicesMessageFilter> tsf_message_filter( |
213 new base::win::TextServicesMessageFilter); | 211 new base::win::TextServicesMessageFilter); |
214 if (tsf_message_filter->Init()) { | 212 if (tsf_message_filter->Init()) { |
215 MessageLoopForUI::current()->SetMessageFilter( | 213 MessageLoopForUI::current()->SetMessageFilter( |
216 tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>()); | 214 tsf_message_filter.PassAs<MessageLoopForUI::MessageFilter>()); |
217 } | 215 } |
218 } | 216 } |
219 } | 217 } |
220 | 218 |
221 void ChromeBrowserMainPartsWin::PreMainMessageLoopRun() { | 219 void ChromeBrowserMainPartsWin::PreProfileInit() { |
222 ChromeBrowserMainParts::PreMainMessageLoopRun(); | 220 removable_device_notifications_window_.reset( |
| 221 chrome::RemovableDeviceNotificationsWindowWin::Create()); |
223 | 222 |
| 223 ChromeBrowserMainParts::PreProfileInit(); |
| 224 } |
| 225 |
| 226 void ChromeBrowserMainPartsWin::PostProfileInit() { |
224 removable_device_notifications_window_->Init(); | 227 removable_device_notifications_window_->Init(); |
| 228 |
| 229 ChromeBrowserMainParts::PostProfileInit(); |
225 } | 230 } |
226 | 231 |
227 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() { | 232 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() { |
228 ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage), | 233 ui::MessageBox(NULL, ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage), |
229 ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle), | 234 ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle), |
230 MB_OK | MB_ICONERROR | MB_TOPMOST); | 235 MB_OK | MB_ICONERROR | MB_TOPMOST); |
231 } | 236 } |
232 | 237 |
233 // static | 238 // static |
234 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( | 239 void ChromeBrowserMainPartsWin::PrepareRestartOnCrashEnviroment( |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 if (resource_id) | 404 if (resource_id) |
400 return l10n_util::GetStringUTF16(resource_id); | 405 return l10n_util::GetStringUTF16(resource_id); |
401 return string16(); | 406 return string16(); |
402 } | 407 } |
403 | 408 |
404 // static | 409 // static |
405 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 410 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
406 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 411 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
407 installer::SetTranslationDelegate(&delegate); | 412 installer::SetTranslationDelegate(&delegate); |
408 } | 413 } |
OLD | NEW |