Fix building on Windows

This commit is contained in:
Cheng Zhao 2016-07-05 09:31:29 +09:00
parent 8d3e09747a
commit 381689d3ed
6 changed files with 15 additions and 13 deletions

View file

@ -19,7 +19,6 @@
#include "base/win/windows_version.h"
#include "content/public/app/sandbox_helper_win.h"
#include "sandbox/win/src/sandbox_types.h"
#include "ui/gfx/win/dpi.h"
#elif defined(OS_LINUX) // defined(OS_WIN)
#include "atom/app/atom_main_delegate.h" // NOLINT
#include "content/public/app/content_main.h"

View file

@ -51,7 +51,7 @@
#include "atom/browser/ui/win/atom_desktop_window_tree_host_win.h"
#include "skia/ext/skia_utils_win.h"
#include "ui/base/win/shell.h"
#include "ui/gfx/win/dpi.h"
#include "ui/display/win/screen_win.h"
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
#endif
@ -1093,9 +1093,11 @@ gfx::Size NativeWindowViews::ContentSizeToWindowSize(const gfx::Size& size) {
gfx::Size window_size(size);
#if defined(OS_WIN)
gfx::Rect dpi_bounds =
gfx::Rect(gfx::Point(), gfx::win::DIPToScreenSize(size));
gfx::Rect window_bounds = gfx::win::ScreenToDIPRect(
HWND hwnd = GetAcceleratedWidget();
gfx::Rect dpi_bounds = gfx::Rect(
gfx::Point(), display::win::ScreenWin::DIPToScreenSize(hwnd, size));
gfx::Rect window_bounds = display::win::ScreenWin::ScreenToDIPRect(
hwnd,
window_->non_client_view()->GetWindowBoundsForClientBounds(dpi_bounds));
window_size = window_bounds.size();
#endif
@ -1111,16 +1113,16 @@ gfx::Size NativeWindowViews::WindowSizeToContentSize(const gfx::Size& size) {
gfx::Size content_size(size);
#if defined(OS_WIN)
content_size = gfx::win::DIPToScreenSize(content_size);
HWND hwnd = GetAcceleratedWidget();
content_size = display::win::ScreenWin::DIPToScreenSize(hwnd, content_size);
RECT rect;
SetRectEmpty(&rect);
HWND hwnd = GetAcceleratedWidget();
DWORD style = ::GetWindowLong(hwnd, GWL_STYLE);
DWORD ex_style = ::GetWindowLong(hwnd, GWL_EXSTYLE);
AdjustWindowRectEx(&rect, style, FALSE, ex_style);
content_size.set_width(content_size.width() - (rect.right - rect.left));
content_size.set_height(content_size.height() - (rect.bottom - rect.top));
content_size = gfx::win::ScreenToDIPSize(content_size);
content_size = display::win::ScreenWin::ScreenToDIPSize(hwnd, content_size);
#endif
if (menu_bar_ && menu_bar_visible_)

View file

@ -13,7 +13,7 @@
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/display/screen.h"
#include "ui/gfx/win/dpi.h"
#include "ui/display/win/screen_win.h"
#include "ui/views/controls/menu/menu_runner.h"
namespace atom {
@ -167,7 +167,7 @@ gfx::Rect NotifyIcon::GetBounds() {
RECT rect = { 0 };
Shell_NotifyIconGetRect(&icon_id, &rect);
return gfx::win::ScreenToDIPRect(gfx::Rect(rect));
return display::win::ScreenWin::ScreenToDIPRect(window_, gfx::Rect(rect));
}
void NotifyIcon::InitIconData(NOTIFYICONDATA* icon_data) {

View file

@ -5,6 +5,7 @@
#ifndef ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_WIN_H_
#define ATOM_COMMON_CRASH_REPORTER_CRASH_REPORTER_WIN_H_
#include <memory>
#include <string>
#include <vector>

View file

@ -104,7 +104,7 @@ class PdfToEmfUtilityProcessHostClient
// UtilityProcessHostClient implementation.
virtual void OnProcessCrashed(int exit_code) override;
virtual void OnProcessLaunchFailed() override;
virtual void OnProcessLaunchFailed(int exit_code) override;
virtual bool OnMessageReceived(const IPC::Message& message) override;
private:
@ -423,7 +423,7 @@ void PdfToEmfUtilityProcessHostClient::OnProcessCrashed(int exit_code) {
OnFailed();
}
void PdfToEmfUtilityProcessHostClient::OnProcessLaunchFailed() {
void PdfToEmfUtilityProcessHostClient::OnProcessLaunchFailed(int exit_code) {
OnFailed();
}

View file

@ -8,7 +8,7 @@ import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '1dd3cbf7c4d3cc6511fa1a2a145b0e9cd86752b6'
LIBCHROMIUMCONTENT_COMMIT = 'e078493ea80ebf66f4b2c6dd4cadd1b529228da6'
PLATFORM = {
'cygwin': 'win32',