👕 Remove linter errors

This commit is contained in:
Kevin Sawicki 2017-06-29 16:50:55 -07:00 committed by Aleksei Kuzmin
parent c7cf844bcd
commit 4bb95acc2b
6 changed files with 33 additions and 20 deletions

View file

@ -1245,18 +1245,20 @@ void WebContents::HasServiceWorker(
struct WrappedCallback {
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) {
callback_.Run(capability != content::ServiceWorkerCapability::NO_SERVICE_WORKER);
callback_.Run(capability !=
content::ServiceWorkerCapability::NO_SERVICE_WORKER);
delete this;
}
};
auto wrapped_callback = new WrappedCallback(callback);
context->CheckHasServiceWorker(web_contents()->GetLastCommittedURL(),
GURL::EmptyGURL(),
base::Bind(&WrappedCallback::Run, base::Unretained(wrapped_callback)));
context->CheckHasServiceWorker(
web_contents()->GetLastCommittedURL(), GURL::EmptyGURL(),
base::Bind(&WrappedCallback::Run, base::Unretained(wrapped_callback)));
}
void WebContents::UnregisterServiceWorker(

View file

@ -1271,8 +1271,8 @@ void NativeWindowViews::HandleKeyboardEvent(
if (event.GetType() == blink::WebInputEvent::kRawKeyDown && IsAltKey(event)) {
// When a single Alt is pressed:
menu_bar_alt_pressed_ = true;
} else if (event.GetType() == blink::WebInputEvent::kKeyUp && IsAltKey(event) &&
menu_bar_alt_pressed_) {
} else if (event.GetType() == blink::WebInputEvent::kKeyUp &&
IsAltKey(event) && menu_bar_alt_pressed_) {
// When a single Alt is released right after a Alt is pressed:
menu_bar_alt_pressed_ = false;
SetMenuBarVisibility(!menu_bar_visible_);

View file

@ -5,6 +5,8 @@
#include "atom/browser/osr/osr_render_widget_host_view.h"
#include <algorithm>
#include <memory>
#include <utility>
#include <vector>
#include "base/callback_helpers.h"
@ -90,10 +92,11 @@ ui::MouseEvent UiMouseEventFromWebMouseEvent(blink::WebMouseEvent event) {
}
ui::MouseEvent ui_event(type,
gfx::Point(std::floor(event.PositionInWidget().x), std::floor(event.PositionInWidget().y)),
gfx::Point(std::floor(event.PositionInWidget().x), std::floor(event.PositionInWidget().y)),
ui::EventTimeForNow(),
button_flags, button_flags);
gfx::Point(std::floor(event.PositionInWidget().x),
std::floor(event.PositionInWidget().y)),
gfx::Point(std::floor(event.PositionInWidget().x),
std::floor(event.PositionInWidget().y)),
ui::EventTimeForNow(), button_flags, button_flags);
ui_event.SetClickCount(event.click_count);
return ui_event;
@ -1111,7 +1114,8 @@ void OffScreenRenderWidgetHostView::ProcessMouseEvent(
const ui::LatencyInfo& latency) {
for (auto proxy_view : proxy_views_) {
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);
proxy_event.SetPositionInWidget(
proxy_event.PositionInWidget().x - bounds.x(),
@ -1128,8 +1132,10 @@ void OffScreenRenderWidgetHostView::ProcessMouseEvent(
event.PositionInWidget().x, event.PositionInWidget().y)) {
blink::WebMouseEvent popup_event(event);
popup_event.SetPositionInWidget(
popup_event.PositionInWidget().x - popup_host_view_->popup_position_.x(),
popup_event.PositionInWidget().y - popup_host_view_->popup_position_.y());
popup_event.PositionInWidget().x -
popup_host_view_->popup_position_.x(),
popup_event.PositionInWidget().y -
popup_host_view_->popup_position_.y());
popup_host_view_->ProcessMouseEvent(popup_event, latency);
return;
@ -1146,7 +1152,8 @@ void OffScreenRenderWidgetHostView::ProcessMouseWheelEvent(
const ui::LatencyInfo& latency) {
for (auto proxy_view : proxy_views_) {
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);
proxy_event.SetPositionInWidget(
proxy_event.PositionInWidget().x - bounds.x(),
@ -1164,8 +1171,10 @@ void OffScreenRenderWidgetHostView::ProcessMouseWheelEvent(
event.PositionInWidget().x, event.PositionInWidget().y)) {
blink::WebMouseWheelEvent popup_event(event);
popup_event.SetPositionInWidget(
popup_event.PositionInWidget().x - popup_host_view_->popup_position_.x(),
popup_event.PositionInWidget().y - popup_host_view_->popup_position_.y());
popup_event.PositionInWidget().x -
popup_host_view_->popup_position_.x(),
popup_event.PositionInWidget().y -
popup_host_view_->popup_position_.y());
popup_host_view_->ProcessMouseWheelEvent(popup_event, latency);
return;
} else {

View file

@ -162,7 +162,8 @@ void AutofillAgent::ShowSuggestions(
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();
}

View file

@ -28,7 +28,8 @@ class AutofillAgent : public content::RenderFrameObserver,
void DidChangeScrollOffset() override;
void FocusedNodeChanged(const blink::WebNode&) override;
void DidCompleteFocusChangeInFrame() override;
void DidReceiveLeftMouseDownOrGestureTapInNode(const blink::WebNode&) override;
void DidReceiveLeftMouseDownOrGestureTapInNode(
const blink::WebNode&) override;
private:
struct ShowSuggestionsOptions {