👕 Remove linter errors
This commit is contained in:
parent
c7cf844bcd
commit
4bb95acc2b
6 changed files with 33 additions and 20 deletions
|
@ -1245,18 +1245,20 @@ void WebContents::HasServiceWorker(
|
||||||
|
|
||||||
struct WrappedCallback {
|
struct WrappedCallback {
|
||||||
base::Callback<void(bool)> callback_;
|
base::Callback<void(bool)> callback_;
|
||||||
WrappedCallback(const base::Callback<void(bool)>& callback) : callback_(callback) {}
|
explicit WrappedCallback(const base::Callback<void(bool)>& callback)
|
||||||
|
: callback_(callback) {}
|
||||||
void Run(content::ServiceWorkerCapability capability) {
|
void Run(content::ServiceWorkerCapability capability) {
|
||||||
callback_.Run(capability != content::ServiceWorkerCapability::NO_SERVICE_WORKER);
|
callback_.Run(capability !=
|
||||||
|
content::ServiceWorkerCapability::NO_SERVICE_WORKER);
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
auto wrapped_callback = new WrappedCallback(callback);
|
auto wrapped_callback = new WrappedCallback(callback);
|
||||||
|
|
||||||
context->CheckHasServiceWorker(web_contents()->GetLastCommittedURL(),
|
context->CheckHasServiceWorker(
|
||||||
GURL::EmptyGURL(),
|
web_contents()->GetLastCommittedURL(), GURL::EmptyGURL(),
|
||||||
base::Bind(&WrappedCallback::Run, base::Unretained(wrapped_callback)));
|
base::Bind(&WrappedCallback::Run, base::Unretained(wrapped_callback)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::UnregisterServiceWorker(
|
void WebContents::UnregisterServiceWorker(
|
||||||
|
|
|
@ -23,7 +23,7 @@ void CopyPixelsToBuffer(const SkBitmap& bitmap,
|
||||||
|
|
||||||
memcpy(node::Buffer::Data(buffer), bitmap.getPixels(), rgb_arr_size);
|
memcpy(node::Buffer::Data(buffer), bitmap.getPixels(), rgb_arr_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
namespace api {
|
namespace api {
|
||||||
|
|
|
@ -1271,8 +1271,8 @@ void NativeWindowViews::HandleKeyboardEvent(
|
||||||
if (event.GetType() == blink::WebInputEvent::kRawKeyDown && IsAltKey(event)) {
|
if (event.GetType() == blink::WebInputEvent::kRawKeyDown && IsAltKey(event)) {
|
||||||
// When a single Alt is pressed:
|
// When a single Alt is pressed:
|
||||||
menu_bar_alt_pressed_ = true;
|
menu_bar_alt_pressed_ = true;
|
||||||
} else if (event.GetType() == blink::WebInputEvent::kKeyUp && IsAltKey(event) &&
|
} else if (event.GetType() == blink::WebInputEvent::kKeyUp &&
|
||||||
menu_bar_alt_pressed_) {
|
IsAltKey(event) && menu_bar_alt_pressed_) {
|
||||||
// When a single Alt is released right after a Alt is pressed:
|
// When a single Alt is released right after a Alt is pressed:
|
||||||
menu_bar_alt_pressed_ = false;
|
menu_bar_alt_pressed_ = false;
|
||||||
SetMenuBarVisibility(!menu_bar_visible_);
|
SetMenuBarVisibility(!menu_bar_visible_);
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
#include "atom/browser/osr/osr_render_widget_host_view.h"
|
#include "atom/browser/osr/osr_render_widget_host_view.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <memory>
|
||||||
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/callback_helpers.h"
|
#include "base/callback_helpers.h"
|
||||||
|
@ -90,10 +92,11 @@ ui::MouseEvent UiMouseEventFromWebMouseEvent(blink::WebMouseEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ui::MouseEvent ui_event(type,
|
ui::MouseEvent ui_event(type,
|
||||||
gfx::Point(std::floor(event.PositionInWidget().x), std::floor(event.PositionInWidget().y)),
|
gfx::Point(std::floor(event.PositionInWidget().x),
|
||||||
gfx::Point(std::floor(event.PositionInWidget().x), std::floor(event.PositionInWidget().y)),
|
std::floor(event.PositionInWidget().y)),
|
||||||
ui::EventTimeForNow(),
|
gfx::Point(std::floor(event.PositionInWidget().x),
|
||||||
button_flags, button_flags);
|
std::floor(event.PositionInWidget().y)),
|
||||||
|
ui::EventTimeForNow(), button_flags, button_flags);
|
||||||
ui_event.SetClickCount(event.click_count);
|
ui_event.SetClickCount(event.click_count);
|
||||||
|
|
||||||
return ui_event;
|
return ui_event;
|
||||||
|
@ -1111,7 +1114,8 @@ void OffScreenRenderWidgetHostView::ProcessMouseEvent(
|
||||||
const ui::LatencyInfo& latency) {
|
const ui::LatencyInfo& latency) {
|
||||||
for (auto proxy_view : proxy_views_) {
|
for (auto proxy_view : proxy_views_) {
|
||||||
gfx::Rect bounds = proxy_view->GetBounds();
|
gfx::Rect bounds = proxy_view->GetBounds();
|
||||||
if (bounds.Contains(event.PositionInWidget().x, event.PositionInWidget().y)) {
|
if (bounds.Contains(event.PositionInWidget().x,
|
||||||
|
event.PositionInWidget().y)) {
|
||||||
blink::WebMouseEvent proxy_event(event);
|
blink::WebMouseEvent proxy_event(event);
|
||||||
proxy_event.SetPositionInWidget(
|
proxy_event.SetPositionInWidget(
|
||||||
proxy_event.PositionInWidget().x - bounds.x(),
|
proxy_event.PositionInWidget().x - bounds.x(),
|
||||||
|
@ -1128,8 +1132,10 @@ void OffScreenRenderWidgetHostView::ProcessMouseEvent(
|
||||||
event.PositionInWidget().x, event.PositionInWidget().y)) {
|
event.PositionInWidget().x, event.PositionInWidget().y)) {
|
||||||
blink::WebMouseEvent popup_event(event);
|
blink::WebMouseEvent popup_event(event);
|
||||||
popup_event.SetPositionInWidget(
|
popup_event.SetPositionInWidget(
|
||||||
popup_event.PositionInWidget().x - popup_host_view_->popup_position_.x(),
|
popup_event.PositionInWidget().x -
|
||||||
popup_event.PositionInWidget().y - popup_host_view_->popup_position_.y());
|
popup_host_view_->popup_position_.x(),
|
||||||
|
popup_event.PositionInWidget().y -
|
||||||
|
popup_host_view_->popup_position_.y());
|
||||||
|
|
||||||
popup_host_view_->ProcessMouseEvent(popup_event, latency);
|
popup_host_view_->ProcessMouseEvent(popup_event, latency);
|
||||||
return;
|
return;
|
||||||
|
@ -1146,7 +1152,8 @@ void OffScreenRenderWidgetHostView::ProcessMouseWheelEvent(
|
||||||
const ui::LatencyInfo& latency) {
|
const ui::LatencyInfo& latency) {
|
||||||
for (auto proxy_view : proxy_views_) {
|
for (auto proxy_view : proxy_views_) {
|
||||||
gfx::Rect bounds = proxy_view->GetBounds();
|
gfx::Rect bounds = proxy_view->GetBounds();
|
||||||
if (bounds.Contains(event.PositionInWidget().x, event.PositionInWidget().y)) {
|
if (bounds.Contains(event.PositionInWidget().x,
|
||||||
|
event.PositionInWidget().y)) {
|
||||||
blink::WebMouseWheelEvent proxy_event(event);
|
blink::WebMouseWheelEvent proxy_event(event);
|
||||||
proxy_event.SetPositionInWidget(
|
proxy_event.SetPositionInWidget(
|
||||||
proxy_event.PositionInWidget().x - bounds.x(),
|
proxy_event.PositionInWidget().x - bounds.x(),
|
||||||
|
@ -1164,8 +1171,10 @@ void OffScreenRenderWidgetHostView::ProcessMouseWheelEvent(
|
||||||
event.PositionInWidget().x, event.PositionInWidget().y)) {
|
event.PositionInWidget().x, event.PositionInWidget().y)) {
|
||||||
blink::WebMouseWheelEvent popup_event(event);
|
blink::WebMouseWheelEvent popup_event(event);
|
||||||
popup_event.SetPositionInWidget(
|
popup_event.SetPositionInWidget(
|
||||||
popup_event.PositionInWidget().x - popup_host_view_->popup_position_.x(),
|
popup_event.PositionInWidget().x -
|
||||||
popup_event.PositionInWidget().y - popup_host_view_->popup_position_.y());
|
popup_host_view_->popup_position_.x(),
|
||||||
|
popup_event.PositionInWidget().y -
|
||||||
|
popup_host_view_->popup_position_.y());
|
||||||
popup_host_view_->ProcessMouseWheelEvent(popup_event, latency);
|
popup_host_view_->ProcessMouseWheelEvent(popup_event, latency);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -162,7 +162,8 @@ void AutofillAgent::ShowSuggestions(
|
||||||
ShowPopup(element, data_list_values, data_list_labels);
|
ShowPopup(element, data_list_values, data_list_labels);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutofillAgent::DidReceiveLeftMouseDownOrGestureTapInNode(const blink::WebNode& node) {
|
void AutofillAgent::DidReceiveLeftMouseDownOrGestureTapInNode(
|
||||||
|
const blink::WebNode& node) {
|
||||||
focused_node_was_last_clicked_ = !node.IsNull() && node.Focused();
|
focused_node_was_last_clicked_ = !node.IsNull() && node.Focused();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,8 @@ class AutofillAgent : public content::RenderFrameObserver,
|
||||||
void DidChangeScrollOffset() override;
|
void DidChangeScrollOffset() override;
|
||||||
void FocusedNodeChanged(const blink::WebNode&) override;
|
void FocusedNodeChanged(const blink::WebNode&) override;
|
||||||
void DidCompleteFocusChangeInFrame() override;
|
void DidCompleteFocusChangeInFrame() override;
|
||||||
void DidReceiveLeftMouseDownOrGestureTapInNode(const blink::WebNode&) override;
|
void DidReceiveLeftMouseDownOrGestureTapInNode(
|
||||||
|
const blink::WebNode&) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
struct ShowSuggestionsOptions {
|
struct ShowSuggestionsOptions {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue