Skip to content

Commit e7f4c23

Browse files
committed
rebase to Chromium 79
1 parent 020cd1a commit e7f4c23

File tree

8 files changed

+22
-26
lines changed

8 files changed

+22
-26
lines changed

src/api/menu/menu.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "content/public/browser/web_contents.h"
2828
#include "content/public/common/page_zoom.h"
2929
#include "ui/views/controls/menu/menu_runner.h"
30+
#include "third_party/blink/public/common/page/page_zoom.h"
3031

3132
namespace nw {
3233

@@ -71,12 +72,12 @@ void Menu::Call(const std::string& method,
7172
zoom::ZoomController* zoom_controller = zoom::ZoomController::FromWebContents(web_contents);
7273

7374
if (zoom_controller) {
74-
double zoom_factor = content::ZoomLevelToZoomFactor(zoom_controller->GetZoomLevel());
75-
if (zoom_factor > content::kMaximumZoomFactor) {
76-
zoom_factor = content::kMaximumZoomFactor;
75+
double zoom_factor = blink::PageZoomLevelToZoomFactor(zoom_controller->GetZoomLevel());
76+
if (zoom_factor > blink::kMaximumPageZoomFactor) {
77+
zoom_factor = blink::kMaximumPageZoomFactor;
7778
}
78-
if (zoom_factor < content::kMinimumZoomFactor) {
79-
zoom_factor = content::kMinimumZoomFactor;
79+
if (zoom_factor < blink::kMinimumPageZoomFactor) {
80+
zoom_factor = blink::kMinimumPageZoomFactor;
8081
}
8182
x *= zoom_factor;
8283
y *= zoom_factor;

src/api/nw_app_api.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include "base/command_line.h"
88
#include "base/memory/ptr_util.h"
9+
#include "base/message_loop/message_loop_current.h"
910
#include "base/task/post_task.h"
1011
#include "content/public/browser/browser_task_traits.h"
1112
#include "chrome/browser/browsing_data/browsing_data_appcache_helper.h"

src/api/nw_screen_api.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ void NwDesktopCaptureMonitor::OnSourceThumbnailChanged(DesktopMediaList* list, i
385385
content::RenderFrameHost* const main_frame = web_contents->GetMainFrame();
386386
result = registry->RegisterStream(main_frame->GetProcess()->GetID(),
387387
main_frame->GetRoutingID(),
388-
web_contents->GetURL().GetOrigin(),
388+
url::Origin::Create(web_contents->GetURL().GetOrigin()),
389389
source,
390390
extension()->name(), content::kRegistryStreamTypeDesktop);
391391
response->AppendString(result);

src/api/nw_window_api.cc

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ using zoom::ZoomController;
7171

7272
using nw::Menu;
7373

74+
extern void SetProgressFraction(float percentage);
75+
extern void SetDownloadCount(int count);
76+
7477
#if defined(OS_LINUX) || defined(OS_WIN)
7578
using nw::MenuBarView;
7679
#endif
@@ -605,21 +608,16 @@ NwCurrentWindowInternalSetBadgeLabelFunction::Run() {
605608

606609
taskbar->SetOverlayIcon(hWnd, icon.get(), L"Status");
607610
#elif defined(OS_LINUX)
608-
views::LinuxUI* linuxUI = views::LinuxUI::instance();
609-
if (linuxUI == NULL) {
610-
error_ = "LinuxUI::instance() is NULL";
611-
return RespondNow(Error(error_));
612-
}
613611
SetDeskopEnvironment();
614-
linuxUI->SetDownloadCount(atoi(badge.c_str()));
612+
SetDownloadCount(atoi(badge.c_str()));
615613
#else
616614
error_ = "NwCurrentWindowInternalSetBadgeLabelFunction NOT Implemented"
617615
NOTIMPLEMENTED() << error_;
618616
return RespondNow(Error(error_));
619617
#endif
620618
return RespondNow(NoArguments());
621619
}
622-
620+
623621
ExtensionFunction::ResponseAction
624622
NwCurrentWindowInternalRequestAttentionInternalFunction::Run() {
625623
EXTENSION_FUNCTION_VALIDATE(args_);
@@ -695,13 +693,8 @@ NwCurrentWindowInternalSetProgressBarFunction::Run() {
695693

696694
taskbar->SetProgressState(hWnd, tbpFlag);
697695
#elif defined(OS_LINUX)
698-
views::LinuxUI* linuxUI = views::LinuxUI::instance();
699-
if (linuxUI == NULL) {
700-
error_ = "LinuxUI::instance() is NULL";
701-
return RespondNow(Error(error_));
702-
}
703696
SetDeskopEnvironment();
704-
linuxUI->SetProgressFraction(progress);
697+
SetProgressFraction(progress);
705698
#else
706699
error_ = "NwCurrentWindowInternalSetProgressBarFunction NOT Implemented"
707700
NOTIMPLEMENTED() << error_;

src/browser/nw_chrome_browser_hooks.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include "sql/meta_table.h"
5959
#include "sql/transaction.h"
6060
#include "storage/common/database/database_identifier.h"
61+
#include "ui/gfx/image/image.h"
6162

6263
#if defined(OS_WIN)
6364
#define _USE_MATH_DEFINES

src/nw_custom_bindings.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ using namespace blink;
5757
#undef INTERNAL_TRACE_EVENT_SCOPED_CONTEXT
5858
//#undef INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE
5959
#endif
60-
#undef EXCLUSIVE_LOCKS_REQUIRED
61-
#undef SHARED_LOCKS_REQUIRED
6260
#undef LOCKS_EXCLUDED
6361
#undef LOCK_RETURNED
6462
//#undef EXCLUSIVE_LOCK_FUNCTION
@@ -80,6 +78,8 @@ using namespace blink;
8078
#undef BLINK_IMPLEMENTATION
8179
#define BLINK_IMPLEMENTATION 1
8280

81+
#include "base/thread_annotations.h"
82+
8383
#include "third_party/blink/public/web/web_document.h"
8484
#include "third_party/blink/public/web/web_security_policy.h"
8585
#include "third_party/blink/renderer/platform/heap/handle.h"

src/nw_version.h

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

2424
#define NW_MAJOR_VERSION 0
25-
#define NW_MINOR_VERSION 42
26-
#define NW_PATCH_VERSION 2
25+
#define NW_MINOR_VERSION 43
26+
#define NW_PATCH_VERSION 0
2727

28-
#define NW_VERSION_IS_RELEASE 1
28+
#define NW_VERSION_IS_RELEASE 0
2929

3030
#ifndef NW_STRINGIFY
3131
#define NW_STRINGIFY(n) NW_STRINGIFY_HELPER(n)

src/nwjs_browsertest.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,13 +841,13 @@ class NWAppTest : public extensions::PlatformAppBrowserTest {
841841
if (iter.GetData().process_type == content::PROCESS_TYPE_PPAPI_PLUGIN)
842842
(*count)++;
843843
}
844-
base::PostTaskWithTraits(FROM_HERE, {content::BrowserThread::UI}, quit_task);
844+
base::PostTask(FROM_HERE, {content::BrowserThread::UI}, quit_task);
845845
}
846846
static void EnsureFlashProcessCount(int expected) {
847847
int actual = 0;
848848
scoped_refptr<content::MessageLoopRunner> runner =
849849
new content::MessageLoopRunner;
850-
base::PostTaskWithTraits(
850+
base::PostTask(
851851
FROM_HERE,
852852
{content::BrowserThread::IO},
853853
base::BindOnce(&CountPluginProcesses, &actual, runner->QuitClosure()));

0 commit comments

Comments
 (0)