summaryrefslogtreecommitdiffstats
path: root/content/app/content_main_runner.cc
diff options
context:
space:
mode:
authorjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-21 21:23:01 +0000
committerjschuh@chromium.org <jschuh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-21 21:23:01 +0000
commitc9bf0ec8511f863c39e82fa95dbb98c60f230007 (patch)
treee0f19a102d7f466a4ddb447a0a0822baa709a445 /content/app/content_main_runner.cc
parent0e30ad2d34d66b8e5eb07a937bed96d556cc2bff (diff)
downloadchromium_src-c9bf0ec8511f863c39e82fa95dbb98c60f230007.zip
chromium_src-c9bf0ec8511f863c39e82fa95dbb98c60f230007.tar.gz
chromium_src-c9bf0ec8511f863c39e82fa95dbb98c60f230007.tar.bz2
Remove EnableThemeSupportOnAllWindowStations
I've investigated and can't find a use for this code post aura. It's also a blocker for disabling win32 in the sandbox. dmazzoni@ + kochi@ - You're added as a heads-up in case anything breaks with accessibility or IME. BUG=365160 R=jam@chromium.org,dmazzoni@chromium.org,kochi@chromium.org Review URL: https://codereview.chromium.org/244543002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/app/content_main_runner.cc')
-rw-r--r--content/app/content_main_runner.cc61
1 files changed, 0 insertions, 61 deletions
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc
index b25dc20..71da1a5 100644
--- a/content/app/content_main_runner.cc
+++ b/content/app/content_main_runner.cc
@@ -117,64 +117,6 @@ extern int UtilityMain(const MainFunctionParams&);
extern int WorkerMain(const MainFunctionParams&);
} // namespace content
-namespace {
-#if defined(OS_WIN)
-// In order to have Theme support, we need to connect to the theme service.
-// This needs to be done before we lock down the process. Officially this
-// can be done with OpenThemeData() but it fails unless you pass a valid
-// window at least the first time. Interestingly, the very act of creating a
-// window also sets the connection to the theme service.
-void EnableThemeSupportOnAllWindowStations() {
- HDESK desktop_handle = ::OpenInputDesktop(0, FALSE, READ_CONTROL);
- if (desktop_handle) {
- // This means we are running in an input desktop, which implies WinSta0.
- ::CloseDesktop(desktop_handle);
- return;
- }
-
- HWINSTA current_station = ::GetProcessWindowStation();
- DCHECK(current_station);
-
- HWINSTA winsta0 = ::OpenWindowStationA("WinSta0", FALSE, GENERIC_READ);
- if (!winsta0) {
- DVLOG(0) << "Unable to open to WinSta0, we: "<< ::GetLastError();
- return;
- }
- if (!::SetProcessWindowStation(winsta0)) {
- // Could not set the alternate window station. There is a possibility
- // that the theme wont be correctly initialized.
- NOTREACHED() << "Unable to switch to WinSta0, we: "<< ::GetLastError();
- ::CloseWindowStation(winsta0);
- return;
- }
-
- HWND window = ::CreateWindowExW(0, L"Static", L"", WS_POPUP | WS_DISABLED,
- CW_USEDEFAULT, 0, 0, 0, HWND_MESSAGE, NULL,
- ::GetModuleHandleA(NULL), NULL);
- if (!window) {
- DLOG(WARNING) << "failed to enable theme support";
- } else {
- ::DestroyWindow(window);
- window = NULL;
- }
-
- // Revert the window station.
- if (!::SetProcessWindowStation(current_station)) {
- // We failed to switch back to the secure window station. This might
- // confuse the process enough that we should kill it now.
- LOG(FATAL) << "Failed to restore alternate window station";
- }
-
- if (!::CloseWindowStation(winsta0)) {
- // We might be leaking a winsta0 handle. This is a security risk, but
- // since we allow fail over to no desktop protection in low memory
- // condition, this is not a big risk.
- NOTREACHED();
- }
-}
-#endif // defined(OS_WIN)
-} // namespace
-
namespace content {
base::LazyInstance<ContentBrowserClient>
@@ -715,9 +657,6 @@ class ContentMainRunnerImpl : public ContentMainRunner {
if (command_line.HasSwitch(switches::kEnableHighResolutionTime))
base::TimeTicks::SetNowIsHighResNowIfSupported();
- // This must be done early enough since some helper functions like
- // IsTouchEnabled, needed to load resources, may call into the theme dll.
- EnableThemeSupportOnAllWindowStations();
SetupCRT(command_line);
#endif