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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 // TODO(viettrungluu): why don't we run this earlier? | 222 // TODO(viettrungluu): why don't we run this earlier? |
223 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) && | 223 if (!parsed_command_line().HasSwitch(switches::kNoErrorDialogs) && |
224 base::win::GetVersion() < base::win::VERSION_XP) { | 224 base::win::GetVersion() < base::win::VERSION_XP) { |
225 chrome::ShowMessageBox(NULL, | 225 chrome::ShowMessageBox(NULL, |
226 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), | 226 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), |
227 l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP), | 227 l10n_util::GetStringUTF16(IDS_UNSUPPORTED_OS_PRE_WIN_XP), |
228 chrome::MESSAGE_BOX_TYPE_WARNING); | 228 chrome::MESSAGE_BOX_TYPE_WARNING); |
229 } | 229 } |
230 | 230 |
231 // Windows 8+ provides a mode where by a process cannot call Win32K/GDI | |
232 // functions in the kernel (win32k.sys). If we are on Windows 8+ and if | |
233 // we are launched with the kEnableWin32kRendererLockDown switch then we | |
234 // force the PDF pepper plugin to run out of process. This is because the | |
235 // PDF plugin uses GDI for text rendering which does not work in the | |
236 // Win32K lockdown mode. Running it out of process ensures that the process | |
237 // launched for the plugin does not have the Win32K lockdown mode enabled. | |
238 // TODO(ananta) | |
239 // Revisit this when the pdf plugin uses skia and stops using GDI. | |
240 if (switches::IsWin32kRendererLockdownEnabled() && | |
241 base::win::GetVersion() >= base::win::VERSION_WIN8) { | |
242 base::CommandLine::ForCurrentProcess()->AppendSwitch( | |
243 switches::kEnableOutOfProcessPdf); | |
244 } | |
245 return rv; | 231 return rv; |
246 } | 232 } |
247 | 233 |
248 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() { | 234 void ChromeBrowserMainPartsWin::ShowMissingLocaleMessageBox() { |
249 ui::MessageBox(NULL, | 235 ui::MessageBox(NULL, |
250 base::ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage), | 236 base::ASCIIToUTF16(chrome_browser::kMissingLocaleDataMessage), |
251 base::ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle), | 237 base::ASCIIToUTF16(chrome_browser::kMissingLocaleDataTitle), |
252 MB_OK | MB_ICONERROR | MB_TOPMOST); | 238 MB_OK | MB_ICONERROR | MB_TOPMOST); |
253 } | 239 } |
254 | 240 |
(...skipping 12 matching lines...) Expand all Loading... |
267 content::BrowserThread::IO, FROM_HERE, | 253 content::BrowserThread::IO, FROM_HERE, |
268 base::Bind(ExecuteFontCacheBuildTask, path)); | 254 base::Bind(ExecuteFontCacheBuildTask, path)); |
269 } | 255 } |
270 } | 256 } |
271 } | 257 } |
272 | 258 |
273 void ChromeBrowserMainPartsWin::PostBrowserStart() { | 259 void ChromeBrowserMainPartsWin::PostBrowserStart() { |
274 ChromeBrowserMainParts::PostBrowserStart(); | 260 ChromeBrowserMainParts::PostBrowserStart(); |
275 | 261 |
276 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice()); | 262 UMA_HISTOGRAM_BOOLEAN("Windows.Tablet", base::win::IsTabletDevice()); |
277 UMA_HISTOGRAM_BOOLEAN("Windows.Win32kRendererLockdown", | |
278 switches::IsWin32kRendererLockdownEnabled()); | |
279 | 263 |
280 // Set up a task to verify installed modules in the current process. Use a | 264 // Set up a task to verify installed modules in the current process. Use a |
281 // delay to reduce the impact on startup time. | 265 // delay to reduce the impact on startup time. |
282 content::BrowserThread::GetMessageLoopProxyForThread( | 266 content::BrowserThread::GetMessageLoopProxyForThread( |
283 content::BrowserThread::UI)->PostDelayedTask( | 267 content::BrowserThread::UI)->PostDelayedTask( |
284 FROM_HERE, | 268 FROM_HERE, |
285 base::Bind(&VerifyInstallation), | 269 base::Bind(&VerifyInstallation), |
286 base::TimeDelta::FromSeconds(45)); | 270 base::TimeDelta::FromSeconds(45)); |
287 | 271 |
288 InitializeChromeElf(); | 272 InitializeChromeElf(); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 if (resource_id) | 459 if (resource_id) |
476 return l10n_util::GetStringUTF16(resource_id); | 460 return l10n_util::GetStringUTF16(resource_id); |
477 return base::string16(); | 461 return base::string16(); |
478 } | 462 } |
479 | 463 |
480 // static | 464 // static |
481 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 465 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
482 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 466 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
483 installer::SetTranslationDelegate(&delegate); | 467 installer::SetTranslationDelegate(&delegate); |
484 } | 468 } |
OLD | NEW |