Skip to content

Commit

Permalink
Remove GetMonitorInfoWrapper, which is no longer needed.
Browse files Browse the repository at this point in the history
We always use ASH on Windows, so the code in the wrapper does not have any effect. This removes the wrapper and updates the callers to use the unwrapped Windows API verison.

R=shrikant@chromium.org
BUG=247430

Review URL: https://codereview.chromium.org/137353002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247204 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
brettw@chromium.org committed Jan 27, 2014
1 parent e2bdf91 commit f1ccd1c
Show file tree
Hide file tree
Showing 10 changed files with 3,236 additions and 45 deletions.
27 changes: 0 additions & 27 deletions base/win/win_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -329,33 +329,6 @@ bool DismissVirtualKeyboard() {

typedef HWND (*MetroRootWindow) ();

// As of this writing, GetMonitorInfo function seem to return wrong values
// for rcWork.left and rcWork.top in case of split screen situation inside
// metro mode. In order to get required values we query for core window screen
// coordinates.
// TODO(shrikant): Remove detour code once GetMonitorInfo is fixed for 8.1.
BOOL GetMonitorInfoWrapper(HMONITOR monitor, MONITORINFO* mi) {
BOOL ret = ::GetMonitorInfo(monitor, mi);
#if !defined(USE_ASH)
if (base::win::IsMetroProcess() &&
base::win::GetVersion() >= base::win::VERSION_WIN8_1) {
static MetroRootWindow root_window = NULL;
if (!root_window) {
HMODULE metro = base::win::GetMetroModule();
// There are apparently instances when current process is inside metro
// environment but metro driver dll is not loaded.
if (!metro) {
return ret;
}
root_window = reinterpret_cast<MetroRootWindow>(
::GetProcAddress(metro, "GetRootWindow"));
}
ret = ::GetWindowRect(root_window(), &(mi->rcWork));
}
#endif
return ret;
}

bool IsEnrolledToDomain() {
LPWSTR domain;
NETSETUP_JOIN_STATUS join_status;
Expand Down
4 changes: 0 additions & 4 deletions base/win/win_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ BASE_EXPORT bool DisplayVirtualKeyboard();
// above. Returns true on success.
BASE_EXPORT bool DismissVirtualKeyboard();

// Returns monitor info after correcting rcWorkArea based on metro version.
// see bug #247430 for more details.
BASE_EXPORT BOOL GetMonitorInfoWrapper(HMONITOR monitor, MONITORINFO* mi);

// Returns true if the machine is enrolled to a domain.
BASE_EXPORT bool IsEnrolledToDomain();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ BOOL CALLBACK EnumMonitorCallback(HMONITOR monitor,
MONITORINFOEX monitor_info;
ZeroMemory(&monitor_info, sizeof(MONITORINFOEX));
monitor_info.cbSize = sizeof(monitor_info);
base::win::GetMonitorInfoWrapper(monitor, &monitor_info);
GetMonitorInfo(monitor, &monitor_info);

DISPLAY_DEVICE device;
device.cb = sizeof(device);
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/fullscreen_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static bool IsFullScreenWindowMode() {
if (!monitor)
return false;
MONITORINFO monitor_info = { sizeof(monitor_info) };
if (!base::win::GetMonitorInfoWrapper(monitor, &monitor_info))
if (!::GetMonitorInfo(monitor, &monitor_info))
return false;

// It should be the main monitor.
Expand Down
Loading

0 comments on commit f1ccd1c

Please sign in to comment.