Update to Chromium revision 2b3ae3b8 (#394939)

This commit is contained in:
Marshall Greenblatt
2016-05-24 19:35:43 -04:00
parent 582ce074aa
commit ab2636b012
125 changed files with 619 additions and 626 deletions

View File

@@ -267,8 +267,9 @@ std::unique_ptr<CefJavaScriptDialogRunner>
return native_delegate_->CreateJavaScriptDialogRunner();
}
std::unique_ptr<CefMenuRunner> CefBrowserPlatformDelegateViews::CreateMenuRunner() {
return make_scoped_ptr(new CefMenuRunnerViews(browser_view_.get()));
std::unique_ptr<CefMenuRunner>
CefBrowserPlatformDelegateViews::CreateMenuRunner() {
return base::WrapUnique(new CefMenuRunnerViews(browser_view_.get()));
}
bool CefBrowserPlatformDelegateViews::IsWindowless() const {

View File

@@ -6,12 +6,12 @@
#include "libcef/browser/views/view_util.h"
#include "ui/gfx/screen.h"
#include "ui/display/screen.h"
// static
CefRefPtr<CefDisplay> CefDisplay::GetPrimaryDisplay() {
CEF_REQUIRE_UIT_RETURN(nullptr);
return new CefDisplayImpl(gfx::Screen::GetScreen()->GetPrimaryDisplay());
return new CefDisplayImpl(display::Screen::GetScreen()->GetPrimaryDisplay());
}
// static
@@ -36,7 +36,7 @@ CefRefPtr<CefDisplay> CefDisplay::GetDisplayMatchingBounds(
// static
size_t CefDisplay::GetDisplayCount() {
CEF_REQUIRE_UIT_RETURN(0U);
return static_cast<size_t>(gfx::Screen::GetScreen()->GetNumDisplays());
return static_cast<size_t>(display::Screen::GetScreen()->GetNumDisplays());
}
// static
@@ -45,13 +45,13 @@ void CefDisplay::GetAllDisplays(std::vector<CefRefPtr<CefDisplay> >& displays) {
displays.clear();
typedef std::vector<gfx::Display> DisplayVector;
DisplayVector vec = gfx::Screen::GetScreen()->GetAllDisplays();
typedef std::vector<display::Display> DisplayVector;
DisplayVector vec = display::Screen::GetScreen()->GetAllDisplays();
for (size_t i = 0; i < vec.size(); ++i)
displays.push_back(new CefDisplayImpl(vec[i]));
}
CefDisplayImpl::CefDisplayImpl(const gfx::Display& display)
CefDisplayImpl::CefDisplayImpl(const display::Display& display)
: display_(display) {
CEF_REQUIRE_UIT();
}

View File

@@ -9,11 +9,11 @@
#include "include/views/cef_display.h"
#include "libcef/browser/thread_util.h"
#include "ui/gfx/display.h"
#include "ui/display/display.h"
class CefDisplayImpl : public CefDisplay {
public:
explicit CefDisplayImpl(const gfx::Display& display);
explicit CefDisplayImpl(const display::Display& display);
~CefDisplayImpl() override;
// CefDisplay methods:
@@ -25,10 +25,10 @@ class CefDisplayImpl : public CefDisplay {
CefRect GetWorkArea() override;
int GetRotation() override;
const gfx::Display& display() const { return display_; }
const display::Display& display() const { return display_; }
private:
gfx::Display display_;
display::Display display_;
IMPLEMENT_REFCOUNTING_DELETE_ON_UIT(CefDisplayImpl);
DISALLOW_COPY_AND_ASSIGN(CefDisplayImpl);

View File

@@ -620,7 +620,8 @@ CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsEnabled() {
CEF_VIEW_IMPL_T void CEF_VIEW_IMPL_D::SetFocusable(bool focusable) {
CEF_REQUIRE_VALID_RETURN_VOID();
root_view()->SetFocusable(focusable);
root_view()->SetFocusBehavior(focusable ? views::View::FocusBehavior::ALWAYS :
views::View::FocusBehavior::NEVER);
}
CEF_VIEW_IMPL_T bool CEF_VIEW_IMPL_D::IsFocusable() {

View File

@@ -12,13 +12,14 @@
#include "ui/aura/window_tree_host.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/screen.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/window/non_client_view.h"
#if defined(OS_WIN)
#include "ui/gfx/win/dpi.h"
#include "ui/display/win/screen_win.h"
#endif
namespace view_util {
@@ -180,24 +181,26 @@ CefRefPtr<CefWindow> GetWindowFor(views::Widget* widget) {
return window;
}
gfx::Display GetDisplayNearestPoint(const gfx::Point& point,
bool input_pixel_coords) {
display::Display GetDisplayNearestPoint(const gfx::Point& point,
bool input_pixel_coords) {
gfx::Point find_point = point;
#if defined(OS_WIN)
if (input_pixel_coords)
find_point = gfx::win::ScreenToDIPPoint(point);
find_point = display::win::ScreenWin::ScreenToDIPPoint(point);
#endif
return gfx::Screen::GetScreen()->GetDisplayNearestPoint(find_point);
return display::Screen::GetScreen()->GetDisplayNearestPoint(find_point);
}
gfx::Display GetDisplayMatchingBounds(const gfx::Rect& bounds,
bool input_pixel_coords) {
display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds,
bool input_pixel_coords) {
gfx::Rect find_bounds = bounds;
#if defined(OS_WIN)
if (input_pixel_coords)
find_bounds = gfx::win::ScreenToDIPRect(find_bounds);
if (input_pixel_coords) {
find_bounds = display::win::ScreenWin::ScreenToDIPRect(nullptr,
find_bounds);
}
#endif
return gfx::Screen::GetScreen()->GetDisplayMatching(bounds);
return display::Screen::GetScreen()->GetDisplayMatching(bounds);
}
void ConvertPointFromPixels(gfx::Point* point,
@@ -221,7 +224,7 @@ bool ConvertPointToScreen(views::View* view,
views::View::ConvertPointToScreen(view, point);
if (output_pixel_coords) {
const gfx::Display& display = GetDisplayNearestPoint(*point, false);
const display::Display& display = GetDisplayNearestPoint(*point, false);
ConvertPointToPixels(point, display.device_scale_factor());
}
@@ -235,7 +238,7 @@ bool ConvertPointFromScreen(views::View* view,
return false;
if (input_pixel_coords) {
const gfx::Display& display = GetDisplayNearestPoint(*point, true);
const display::Display& display = GetDisplayNearestPoint(*point, true);
ConvertPointFromPixels(point, display.device_scale_factor());
}

View File

@@ -11,8 +11,11 @@
#include "ui/views/view.h"
namespace gfx {
namespace display {
class Display;
}
namespace gfx {
class Point;
}
@@ -70,14 +73,14 @@ CefRefPtr<CefWindow> GetWindowFor(views::Widget* widget);
// Returns the Display nearest |point|. Set |input_pixel_coords| to true if
// |point| is in pixel coordinates instead of density independent pixels (DIP).
gfx::Display GetDisplayNearestPoint(const gfx::Point& point,
bool input_pixel_coords);
display::Display GetDisplayNearestPoint(const gfx::Point& point,
bool input_pixel_coords);
// Returns the Display that most closely intersects |bounds|. Set
// |input_pixel_coords| to true if |bounds| is in pixel coordinates instead of
// density independent pixels (DIP).
gfx::Display GetDisplayMatchingBounds(const gfx::Rect& bounds,
bool input_pixel_coords);
display::Display GetDisplayMatchingBounds(const gfx::Rect& bounds,
bool input_pixel_coords);
// Convert |point| from pixel coordinates to density independent pixels (DIP)
// using |device_scale_factor|.

View File

@@ -24,7 +24,7 @@
#endif
#if defined(OS_WIN)
#include "ui/gfx/win/dpi.h"
#include "ui/display/win/screen_win.h"
#endif
namespace {
@@ -379,7 +379,7 @@ void CefWindowImpl::CancelMenu() {
CefRefPtr<CefDisplay> CefWindowImpl::GetDisplay() {
CEF_REQUIRE_VALID_RETURN(nullptr);
if (widget_ && root_view()) {
const gfx::Display& display = root_view()->GetDisplay();
const display::Display& display = root_view()->GetDisplay();
if (display.is_valid())
return new CefDisplayImpl(display);
}
@@ -444,7 +444,7 @@ void CefWindowImpl::SendMouseMove(int screen_x, int screen_y) {
gfx::Point point(screen_x, screen_y);
#if defined(OS_WIN)
// Windows expects pixel coordinates.
point = gfx::win::DIPToScreenPoint(point);
point = display::win::ScreenWin::DIPToScreenPoint(point);
#endif
ui_controls::SendMouseMove(point.x(), point.y());

View File

@@ -18,7 +18,7 @@
#endif
#if defined(OS_WIN)
#include "ui/gfx/win/dpi.h"
#include "ui/display/screen.h"
#include "ui/views/win/hwnd_util.h"
#endif
@@ -61,11 +61,14 @@ class NativeFrameViewEx : public views::NativeFrameView {
// views::GetWindowBoundsForClientBounds() expects the input Rect to be in
// pixel coordinates. NativeFrameView does not implement this correctly so
// we need to provide our own implementation. See http://crbug.com/602692.
gfx::Rect pixel_bounds = gfx::win::DIPToScreenRect(client_bounds);
gfx::Rect pixel_bounds =
display::Screen::GetScreen()->DIPToScreenRectInWindow(
view_util::GetNativeWindow(widget_), client_bounds);
pixel_bounds = views::GetWindowBoundsForClientBounds(
static_cast<View*>(const_cast<NativeFrameViewEx*>(this)),
pixel_bounds);
return gfx::win::ScreenToDIPRect(pixel_bounds);
return display::Screen::GetScreen()->ScreenToDIPRectInWindow(
view_util::GetNativeWindow(widget_), pixel_bounds);
#else
// Use the default implementation.
return views::NativeFrameView::GetWindowBoundsForClientBounds(
@@ -427,13 +430,13 @@ void CefWindowView::ViewHierarchyChanged(
ParentClass::ViewHierarchyChanged(details);
}
gfx::Display CefWindowView::GetDisplay() const {
display::Display CefWindowView::GetDisplay() const {
const views::Widget* widget = GetWidget();
if (widget) {
return view_util::GetDisplayMatchingBounds(
widget->GetWindowBoundsInScreen(), false);
}
return gfx::Display();
return display::Display();
}
void CefWindowView::SetTitle(const base::string16& title) {

View File

@@ -11,7 +11,7 @@
#include "libcef/browser/views/panel_view.h"
#include "ui/gfx/display.h"
#include "ui/display/display.h"
#include "ui/views/widget/widget_delegate.h"
class SkRegion;
@@ -71,7 +71,7 @@ class CefWindowView :
const views::View::ViewHierarchyChangedDetails& details) override;
// Returns the Display containing this Window.
gfx::Display GetDisplay() const;
display::Display GetDisplay() const;
// Set/get the window title.
void SetTitle(const base::string16& title);