Skip to content

Commit 8560987

Browse files
committed
rebase to Chromium 59
1 parent 772064c commit 8560987

File tree

16 files changed

+192
-173
lines changed

16 files changed

+192
-173
lines changed

patch/patches/ffmpeg.patch

Lines changed: 91 additions & 91 deletions
Large diffs are not rendered by default.

src/api/nw_app_api.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ bool NwAppClearCacheFunction::RunNWSync(base::ListValue* response, std::string*
130130

131131
remover->AddObserver(this);
132132
remover->RemoveAndReply(base::Time(), base::Time::Max(),
133-
BrowsingDataRemover::REMOVE_CACHE,
134-
BrowsingDataHelper::ALL,
133+
BrowsingDataRemover::DATA_TYPE_CACHE,
134+
BrowsingDataRemover::ORIGIN_TYPE_UNPROTECTED_WEB,
135135
this);
136136
// BrowsingDataRemover deletes itself.
137137
base::MessageLoop::ScopedNestableTaskAllower allow(

src/api/nw_clipboard_api.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,14 @@ bool NwClipboardReadAvailableTypesFunction::RunNWSync(base::ListValue* response,
317317
clipboard->ReadAvailableTypes(ui::CLIPBOARD_TYPE_COPY_PASTE, &types, &contains_filenames);
318318
for(std::vector<base::string16>::iterator it = types.begin(); it != types.end(); it++) {
319319
if (base::EqualsASCII(*it, ui::Clipboard::kMimeTypeText)) {
320-
response->Append(base::WrapUnique(new base::StringValue(ToString(TYPE_TEXT))));
320+
response->Append(base::WrapUnique(new base::Value(ToString(TYPE_TEXT))));
321321
} else if (base::EqualsASCII(*it, ui::Clipboard::kMimeTypeHTML)) {
322-
response->Append(base::WrapUnique(new base::StringValue(ToString(TYPE_HTML))));
322+
response->Append(base::WrapUnique(new base::Value(ToString(TYPE_HTML))));
323323
} else if (base::EqualsASCII(*it, ui::Clipboard::kMimeTypeRTF)) {
324-
response->Append(base::WrapUnique(new base::StringValue(ToString(TYPE_RTF))));
324+
response->Append(base::WrapUnique(new base::Value(ToString(TYPE_RTF))));
325325
} else if (base::EqualsASCII(*it, ui::Clipboard::kMimeTypePNG)) {
326-
response->Append(base::WrapUnique(new base::StringValue(ToString(TYPE_PNG))));
327-
response->Append(base::WrapUnique(new base::StringValue(ToString(TYPE_JPEG))));
326+
response->Append(base::WrapUnique(new base::Value(ToString(TYPE_PNG))));
327+
response->Append(base::WrapUnique(new base::Value(ToString(TYPE_JPEG))));
328328
}
329329
}
330330
return true;

src/api/nw_window_api.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ void NwCurrentWindowInternalCapturePageInternalFunction::OnCaptureSuccess(const
289289
base::Base64Encode(stream_as_string, &base64_result);
290290
base64_result.insert(
291291
0, base::StringPrintf("data:%s;base64,", mime_type.c_str()));
292-
SetResult(base::MakeUnique<base::StringValue>(base64_result.c_str()));
292+
SetResult(base::MakeUnique<base::Value>(base64_result.c_str()));
293293
SendResponse(true);
294294
}
295295

@@ -400,9 +400,9 @@ static base::win::ScopedHICON createBadgeIcon(const HWND hWnd, const TCHAR *valu
400400
gfx::Canvas canvas(gfx::Size(sizeX, sizeY), 1, false);
401401

402402
// drawing red circle
403-
SkPaint paint;
404-
paint.setColor(SK_ColorRED);
405-
canvas.DrawCircle(gfx::Point(sizeX / 2, sizeY / 2), sizeX / 2, paint);
403+
cc::PaintFlags flags;
404+
flags.setColor(SK_ColorRED);
405+
canvas.DrawCircle(gfx::Point(sizeX / 2, sizeY / 2), sizeX / 2, flags);
406406

407407
// drawing the text
408408
gfx::PlatformFont *platform_font = gfx::PlatformFont::CreateDefault();
@@ -696,7 +696,7 @@ bool NwCurrentWindowInternalGetWinParamInternalFunction::RunNWSync(base::ListVal
696696

697697
base::DictionaryValue* result = new base::DictionaryValue;
698698
result->Set("frameId", new base::Value(frame_id));
699-
result->Set("id", new base::StringValue(app_window->window_key()));
699+
result->Set("id", new base::Value(app_window->window_key()));
700700
app_window->GetSerializedState(result);
701701

702702
response->Append(base::WrapUnique(result));

src/api/tray/tray_mac.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ - (void)setBacking:(nw::Tray*)newTray {
4141
}
4242
- (void)onClick:(id)sender {
4343
base::ListValue args;
44-
base::DictionaryValue* data = new base::DictionaryValue;
44+
std::unique_ptr<base::DictionaryValue> data(new base::DictionaryValue);
4545
// Get the position of the frame of the NSStatusItem
4646
NSPoint pos = ([[[NSApp currentEvent] window] frame]).origin;
4747
// Flip coordinates to gfx (0,0 in top-left corner) using primary screen.
4848
NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
4949
pos.y = NSMaxY([screen frame]) - pos.y;
5050
data->SetInteger("x", pos.x);
5151
data->SetInteger("y", pos.y);
52-
args.Append(data);
52+
args.Append(std::move(data));
5353
tray_->object_manager()->SendEvent(tray_,"TrayClick",args);
5454
}
5555
@end

src/browser/nw_chrome_browser_hooks.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ void ShowDevtools(bool show, content::WebContents* web_contents, content::WebCon
144144
if (!window) {
145145
Profile* profile = Profile::FromBrowserContext(
146146
web_contents->GetBrowserContext());
147-
window = DevToolsWindow::Create(profile, GURL(), nullptr, false, false, false, std::string(), false, std::string(), std::string(), container);
147+
window = DevToolsWindow::Create(profile, nullptr, DevToolsWindow::kFrontendDefault, std::string(), false, std::string(), std::string(), container);
148148
if (!window)
149149
return;
150150
window->bindings_->AttachTo(agent_host);

src/browser/nw_extensions_browser_hooks.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ void AmendManifestStringList(base::DictionaryValue* manifest,
104104
if (!pattern_list)
105105
pattern_list = new base::ListValue();
106106

107-
pattern_list->Append(base::WrapUnique(new base::StringValue(string_value)));
107+
pattern_list->Append(base::WrapUnique(new base::Value(string_value)));
108108
if (!amend)
109109
manifest->Set(path, pattern_list);
110110
}
@@ -117,7 +117,7 @@ void AmendManifestList(base::DictionaryValue* manifest,
117117
if (manifest->GetList(path, &pattern_list)) {
118118
base::ListValue::const_iterator it;
119119
for(it = list_value.begin(); it != list_value.end(); ++it) {
120-
pattern_list->Append(base::WrapUnique((*it)->DeepCopy()));
120+
pattern_list->Append((*it).CreateDeepCopy());
121121
}
122122
} else {
123123
pattern_list = list_value.DeepCopy();
@@ -262,7 +262,7 @@ void LoadNWAppAsExtensionHook(base::DictionaryValue* manifest,
262262
base::ListValue* node_remote_list = NULL;
263263
if (node_remote->GetAsString(&node_remote_string)) {
264264
node_remote_list = new base::ListValue();
265-
node_remote_list->Append(base::WrapUnique(new base::StringValue(node_remote_string)));
265+
node_remote_list->Append(base::WrapUnique(new base::Value(node_remote_string)));
266266
} else if (node_remote->GetAsList(&node_remote_list)) {
267267
// do nothing
268268
}

src/nw_content_verifier_delegate.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,7 @@ void NWContentVerifierDelegate::VerifyFailed(
148148
}
149149
}
150150

151+
void NWContentVerifierDelegate::Shutdown() {
152+
}
153+
151154
} // namespace extensions

src/nw_content_verifier_delegate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class NWContentVerifierDelegate : public ContentVerifierDelegate {
3131
void VerifyFailed(const std::string& extension_id,
3232
const base::FilePath& relative_path,
3333
ContentVerifyJob::FailureReason reason) override;
34-
34+
void Shutdown() override;
3535
content::BrowserContext* context_;
3636
ContentVerifierDelegate::Mode default_mode_;
3737

src/nw_custom_bindings.cc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@ void NWCustomBindings::EvalScript(
195195
web_frame = main_frame;
196196
}else{
197197
blink::HTMLIFrameElement* iframe = blink::V8HTMLIFrameElement::toImpl(frm);
198-
web_frame = blink::WebFrame::fromFrame(iframe->contentFrame());
198+
web_frame = blink::WebFrame::FromFrame(iframe->ContentFrame());
199199
}
200200
#if defined(OS_WIN)
201201
base::string16 jscript((WCHAR*)*v8::String::Value(args[1]));
202202
#else
203203
base::string16 jscript = *v8::String::Value(args[1]);
204204
#endif
205205
if (web_frame) {
206-
result = web_frame->executeScriptAndReturnValue(blink::WebScriptSource(blink::WebString::fromUTF16(jscript)));
206+
result = web_frame->ExecuteScriptAndReturnValue(blink::WebScriptSource(blink::WebString::FromUTF16(jscript)));
207207
}
208208
args.GetReturnValue().Set(result);
209209
return;
@@ -242,9 +242,9 @@ void NWCustomBindings::EvalNWBin(
242242
web_frame = main_frame;
243243
}else{
244244
blink::HTMLIFrameElement* iframe = blink::V8HTMLIFrameElement::toImpl(frm);
245-
web_frame = blink::WebFrame::fromFrame(iframe->contentFrame());
245+
web_frame = blink::WebFrame::FromFrame(iframe->ContentFrame());
246246
}
247-
v8::Context::Scope cscope (web_frame->mainWorldScriptContext());
247+
v8::Context::Scope cscope (web_frame->MainWorldScriptContext());
248248
v8::FixSourceNWBin(isolate, script);
249249
result = script->BindToCurrentContext()->Run();
250250
args.GetReturnValue().Set(result);
@@ -270,9 +270,9 @@ void NWCustomBindings::AddOriginAccessWhitelistEntry(const v8::FunctionCallbackI
270270
std::string destinationHost = *v8::String::Utf8Value(args[2]);
271271
bool allowDestinationSubdomains = args[3]->ToBoolean()->Value();
272272

273-
blink::WebSecurityPolicy::addOriginAccessWhitelistEntry(GURL(sourceOrigin),
274-
blink::WebString::fromUTF8(destinationProtocol),
275-
blink::WebString::fromUTF8(destinationHost),
273+
blink::WebSecurityPolicy::AddOriginAccessWhitelistEntry(GURL(sourceOrigin),
274+
blink::WebString::FromUTF8(destinationProtocol),
275+
blink::WebString::FromUTF8(destinationHost),
276276
allowDestinationSubdomains);
277277
args.GetReturnValue().Set(v8::Undefined(isolate));
278278
return;
@@ -286,9 +286,9 @@ void NWCustomBindings::RemoveOriginAccessWhitelistEntry(const v8::FunctionCallba
286286
std::string destinationHost = *v8::String::Utf8Value(args[2]);
287287
bool allowDestinationSubdomains = args[3]->ToBoolean()->Value();
288288

289-
blink::WebSecurityPolicy::removeOriginAccessWhitelistEntry(GURL(sourceOrigin),
290-
blink::WebString::fromUTF8(destinationProtocol),
291-
blink::WebString::fromUTF8(destinationHost),
289+
blink::WebSecurityPolicy::RemoveOriginAccessWhitelistEntry(GURL(sourceOrigin),
290+
blink::WebString::FromUTF8(destinationProtocol),
291+
blink::WebString::FromUTF8(destinationHost),
292292
allowDestinationSubdomains);
293293
args.GetReturnValue().Set(v8::Undefined(isolate));
294294
return;
@@ -327,7 +327,7 @@ void NWCustomBindings::SetDevToolsJail(const v8::FunctionCallbackInfo<v8::Value>
327327
}else{
328328
v8::Handle<v8::Object> frm = v8::Handle<v8::Object>::Cast(args[0]);
329329
blink::HTMLIFrameElement* iframe = blink::V8HTMLIFrameElement::toImpl(frm);
330-
main_frame->setDevtoolsJail(blink::WebFrame::fromFrame(iframe->contentFrame()));
330+
main_frame->setDevtoolsJail(blink::WebFrame::FromFrame(iframe->ContentFrame()));
331331
}
332332
args.GetReturnValue().Set(v8::Undefined(isolate));
333333
return;

src/nw_version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
#define NW_VERSION_H
2323

2424
#define NW_MAJOR_VERSION 0
25-
#define NW_MINOR_VERSION 22
26-
#define NW_PATCH_VERSION 4
25+
#define NW_MINOR_VERSION 23
26+
#define NW_PATCH_VERSION 0
2727

2828
#define NW_VERSION_IS_RELEASE 1
2929

@@ -39,7 +39,7 @@
3939
#else
4040
# define NW_VERSION_STRING NW_STRINGIFY(NW_MAJOR_VERSION) "." \
4141
NW_STRINGIFY(NW_MINOR_VERSION) "." \
42-
NW_STRINGIFY(NW_PATCH_VERSION) "-rc1"
42+
NW_STRINGIFY(NW_PATCH_VERSION) "-beta1"
4343
#endif
4444

4545
#define NW_VERSION "v" NW_VERSION_STRING

src/nwjs_browsertest.cc

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,10 @@ class LeftMouseClick {
278278
public:
279279
explicit LeftMouseClick(content::WebContents* web_contents)
280280
: web_contents_(web_contents),
281-
mouse_event_(blink::WebInputEvent::MouseDown,
282-
blink::WebInputEvent::NoModifiers,
283-
blink::WebInputEvent::TimeStampForTesting) {
284-
mouse_event_.button = blink::WebMouseEvent::Button::Left;
281+
mouse_event_(blink::WebInputEvent::kMouseDown,
282+
blink::WebInputEvent::kNoModifiers,
283+
blink::WebInputEvent::kTimeStampForTesting) {
284+
mouse_event_.button = blink::WebMouseEvent::Button::kLeft;
285285
}
286286

287287
~LeftMouseClick() {
@@ -291,13 +291,12 @@ class LeftMouseClick {
291291
void Click(const gfx::Point& point, int duration_ms) {
292292
DCHECK(click_completed_);
293293
click_completed_ = false;
294-
mouse_event_.setType(blink::WebInputEvent::MouseDown);
295-
mouse_event_.x = point.x();
296-
mouse_event_.y = point.y();
294+
mouse_event_.SetType(blink::WebInputEvent::kMouseDown);
295+
mouse_event_.SetPositionInWidget(point.x(), point.y());
297296
const gfx::Rect offset = web_contents_->GetContainerBounds();
298-
mouse_event_.globalX = point.x() + offset.x();
299-
mouse_event_.globalY = point.y() + offset.y();
300-
mouse_event_.clickCount = 1;
297+
mouse_event_.SetPositionInScreen(point.x() + offset.x(),
298+
point.y() + offset.y());
299+
mouse_event_.click_count = 1;
301300
web_contents_->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(
302301
mouse_event_);
303302

@@ -318,7 +317,7 @@ class LeftMouseClick {
318317

319318
private:
320319
void SendMouseUp() {
321-
mouse_event_.setType(blink::WebInputEvent::MouseUp);
320+
mouse_event_.SetType(blink::WebInputEvent::kMouseUp);
322321
web_contents_->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(
323322
mouse_event_);
324323
click_completed_ = true;
@@ -763,15 +762,14 @@ class NWWebViewTestBase : public extensions::PlatformAppBrowserTest {
763762
}
764763

765764
void OpenContextMenu(content::WebContents* web_contents) {
766-
blink::WebMouseEvent mouse_event(blink::WebInputEvent::MouseDown,
767-
blink::WebInputEvent::NoModifiers,
768-
blink::WebInputEvent::TimeStampForTesting);
769-
mouse_event.button = blink::WebMouseEvent::Button::Right;
770-
mouse_event.x = 1;
771-
mouse_event.y = 1;
765+
blink::WebMouseEvent mouse_event(blink::WebInputEvent::kMouseDown,
766+
blink::WebInputEvent::kNoModifiers,
767+
blink::WebInputEvent::kTimeStampForTesting);
768+
mouse_event.button = blink::WebMouseEvent::Button::kRight;
769+
mouse_event.SetPositionInWidget(1, 1);
772770
web_contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(
773771
mouse_event);
774-
mouse_event.setType(blink::WebInputEvent::MouseUp);
772+
mouse_event.SetType(blink::WebInputEvent::kMouseUp);
775773
web_contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(
776774
mouse_event);
777775
}
@@ -809,7 +807,7 @@ class NWWebViewTestBase : public extensions::PlatformAppBrowserTest {
809807
~NWWebViewTestBase() override {}
810808

811809
protected:
812-
scoped_refptr<content::FrameWatcher> frame_watcher_;
810+
content::FrameWatcher frame_watcher_;
813811

814812
private:
815813
bool UsesFakeSpeech() {

0 commit comments

Comments
 (0)