summaryrefslogtreecommitdiffstats
path: root/win8/delegate_execute/command_execute_impl.cc
diff options
context:
space:
mode:
authorluken@chromium.org <luken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-10 20:49:02 +0000
committerluken@chromium.org <luken@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-10 20:49:02 +0000
commited256aca16b29c6048dd4ee6834d5714e48fa03b (patch)
tree0100a2491480d58fcb1df95a6e92e49957ba98d0 /win8/delegate_execute/command_execute_impl.cc
parent325f8aad2fd0dfcd637bfa76adbce3bd61702cc2 (diff)
downloadchromium_src-ed256aca16b29c6048dd4ee6834d5714e48fa03b.zip
chromium_src-ed256aca16b29c6048dd4ee6834d5714e48fa03b.tar.gz
chromium_src-ed256aca16b29c6048dd4ee6834d5714e48fa03b.tar.bz2
sets/clears highdpi registry settings on switch to/from metro
There are some highdpi bugs in Chrome M35 and M36 that make it not particularly usable in desktop context, but on highdpi devices we require that highdpi mode be enabled when in Metro mode. This CL adds code to delegate_execute to force enable highdpi when entering Metro mode, and to disable it when exiting. BUG=362756 Review URL: https://codereview.chromium.org/323643002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276133 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8/delegate_execute/command_execute_impl.cc')
-rw-r--r--win8/delegate_execute/command_execute_impl.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/win8/delegate_execute/command_execute_impl.cc b/win8/delegate_execute/command_execute_impl.cc
index 4c37e7b..a120828 100644
--- a/win8/delegate_execute/command_execute_impl.cc
+++ b/win8/delegate_execute/command_execute_impl.cc
@@ -28,6 +28,7 @@
#include "chrome/installer/util/shell_util.h"
#include "chrome/installer/util/util_constants.h"
#include "ui/base/clipboard/clipboard_util_win.h"
+#include "ui/gfx/win/dpi.h"
#include "win8/delegate_execute/chrome_util.h"
#include "win8/delegate_execute/delegate_execute_util.h"
#include "win8/viewer/metro_viewer_constants.h"
@@ -107,14 +108,14 @@ bool LaunchChromeBrowserProcess() {
bool CommandExecuteImpl::path_provider_initialized_ = false;
-// CommandExecuteImpl is resposible for activating chrome in Windows 8. The
+// CommandExecuteImpl is responsible for activating chrome in Windows 8. The
// flow is complicated and this tries to highlight the important events.
// The current approach is to have a single instance of chrome either
// running in desktop or metro mode. If there is no current instance then
// the desktop shortcut launches desktop chrome and the metro tile or search
// charm launches metro chrome.
// If chrome is running then focus/activation is given to the existing one
-// regarless of what launch point the user used.
+// regardless of what launch point the user used.
//
// The general flow for activation is as follows:
//
@@ -171,7 +172,7 @@ CommandExecuteImpl::CommandExecuteImpl()
start_info_.cb = sizeof(start_info_);
// We need to query the user data dir of chrome so we need chrome's
- // path provider. We can be created multiplie times in a single instance
+ // path provider. We can be created multiple times in a single instance
// however so make sure we do this only once.
if (!path_provider_initialized_) {
chrome::RegisterPathProvider();
@@ -207,6 +208,13 @@ STDMETHODIMP CommandExecuteImpl::SetDirectory(LPCWSTR directory) {
return S_OK;
}
+void CommandExecuteImpl::SetHighDPIRegistryKey(bool enable) {
+ uint32 key_value = enable ? 1 : 2;
+ base::win::RegKey high_dpi_key(HKEY_CURRENT_USER);
+ high_dpi_key.CreateKey(gfx::win::kRegistryProfilePath, KEY_SET_VALUE);
+ high_dpi_key.WriteValue(gfx::win::kHighDPISupportW, key_value);
+}
+
STDMETHODIMP CommandExecuteImpl::GetValue(enum AHE_TYPE* pahe) {
if (!GetLaunchScheme(&display_name_, &launch_scheme_)) {
AtlTrace("Failed to get scheme, E_FAIL\n");
@@ -222,8 +230,10 @@ STDMETHODIMP CommandExecuteImpl::GetValue(enum AHE_TYPE* pahe) {
// call to CommandExecuteImpl::Execute(). If we wait until then to launch
// the browser process as well, it will appear laggy while they connect to
// each other, so we pre-launch the browser process now.
- if (*pahe == AHE_IMMERSIVE && verb_ != win8::kMetroViewerConnectVerb)
+ if (*pahe == AHE_IMMERSIVE && verb_ != win8::kMetroViewerConnectVerb) {
+ SetHighDPIRegistryKey(true);
LaunchChromeBrowserProcess();
+ }
return S_OK;
}
@@ -388,6 +398,8 @@ HRESULT CommandExecuteImpl::LaunchDesktopChrome() {
break;
}
+ SetHighDPIRegistryKey(false);
+
CommandLine chrome(
delegate_execute::MakeChromeCommandLine(chrome_exe_, parameters_,
display_name));