Fix API changes of FrameSubscriber

This commit is contained in:
Cheng Zhao 2017-04-13 19:21:30 +09:00
parent 6da696b6f2
commit d85b58fdb5
4 changed files with 21 additions and 9 deletions

View file

@ -76,6 +76,7 @@
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebFindOptions.h"
#include "ui/display/screen.h"
#include "ui/events/base_event_utils.h"
#if !defined(OS_MACOSX)
#include "ui/aura/window.h"
@ -1306,7 +1307,7 @@ void WebContents::SelectAll() {
}
void WebContents::Unselect() {
web_contents()->Unselect();
web_contents()->CollapseSelection();
}
void WebContents::Replace(const base::string16& word) {
@ -1396,7 +1397,10 @@ void WebContents::SendInputEvent(v8::Isolate* isolate,
return;
}
} else if (blink::WebInputEvent::isKeyboardEventType(type)) {
content::NativeWebKeyboardEvent keyboard_event;
content::NativeWebKeyboardEvent keyboard_event(
blink::WebKeyboardEvent::RawKeyDown,
blink::WebInputEvent::NoModifiers,
ui::EventTimeForNow());
if (mate::ConvertFromV8(isolate, input_event, &keyboard_event)) {
host->ForwardKeyboardEvent(keyboard_event);
return;
@ -1486,8 +1490,7 @@ void WebContents::CapturePage(mate::Arguments* args) {
}
const auto view = web_contents()->GetRenderWidgetHostView();
const auto host = view ? view->GetRenderWidgetHost() : nullptr;
if (!view || !host) {
if (!view) {
callback.Run(gfx::Image());
return;
}
@ -1507,10 +1510,10 @@ void WebContents::CapturePage(mate::Arguments* args) {
if (scale > 1.0f)
bitmap_size = gfx::ScaleToCeiledSize(view_size, scale);
host->CopyFromBackingStore(gfx::Rect(rect.origin(), view_size),
bitmap_size,
base::Bind(&OnCapturePageDone, callback),
kBGRA_8888_SkColorType);
view->CopyFromSurface(gfx::Rect(rect.origin(), view_size),
bitmap_size,
base::Bind(&OnCapturePageDone, callback),
kBGRA_8888_SkColorType);
}
void WebContents::OnCursorChange(const content::WebCursor& cursor) {