🎨 lint fix
This commit is contained in:
parent
f360104bee
commit
4949531f57
8 changed files with 88 additions and 76 deletions
|
@ -80,7 +80,7 @@ void AutofillPopupView::Show() {
|
|||
|
||||
if (initialize_widget)
|
||||
views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this);
|
||||
|
||||
|
||||
keypress_callback_ = base::Bind(&AutofillPopupView::HandleKeyPressEvent,
|
||||
base::Unretained(this));
|
||||
auto host = popup_->web_contents_->GetRenderViewHost()->GetWidget();
|
||||
|
@ -129,13 +129,13 @@ void AutofillPopupView::DrawAutofillEntry(gfx::Canvas* canvas,
|
|||
entry_rect,
|
||||
GetNativeTheme()->GetSystemColor(
|
||||
popup_->GetBackgroundColorIDForRow(index)));
|
||||
|
||||
|
||||
const bool is_rtl = false;
|
||||
const int text_align =
|
||||
is_rtl ? gfx::Canvas::TEXT_ALIGN_RIGHT : gfx::Canvas::TEXT_ALIGN_LEFT;
|
||||
gfx::Rect value_rect = entry_rect;
|
||||
value_rect.Inset(kEndPadding, 0);
|
||||
|
||||
|
||||
int x_align_left = value_rect.x();
|
||||
const int value_width = gfx::GetStringWidth(
|
||||
popup_->GetValueAt(index),
|
||||
|
@ -143,7 +143,7 @@ void AutofillPopupView::DrawAutofillEntry(gfx::Canvas* canvas,
|
|||
int value_x_align_left = x_align_left;
|
||||
value_x_align_left =
|
||||
is_rtl ? value_rect.right() - value_width : value_rect.x();
|
||||
|
||||
|
||||
canvas->DrawStringRectWithFlags(
|
||||
popup_->GetValueAt(index),
|
||||
popup_->GetValueFontListForRow(index),
|
||||
|
@ -159,7 +159,7 @@ void AutofillPopupView::DrawAutofillEntry(gfx::Canvas* canvas,
|
|||
popup_->GetLabelAt(index),
|
||||
popup_->GetLabelFontListForRow(index));
|
||||
int label_x_align_left = x_align_left;
|
||||
label_x_align_left =
|
||||
label_x_align_left =
|
||||
is_rtl ? value_rect.x() : value_rect.right() - label_width;
|
||||
|
||||
canvas->DrawStringRectWithFlags(
|
||||
|
@ -191,15 +191,15 @@ void AutofillPopupView::DoUpdateBoundsAndRedrawPopup() {
|
|||
void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
|
||||
if (!popup_)
|
||||
return;
|
||||
|
||||
|
||||
canvas->DrawColor(GetNativeTheme()->GetSystemColor(
|
||||
ui::NativeTheme::kColorId_ResultsTableNormalBackground));
|
||||
OnPaintBorder(canvas);
|
||||
|
||||
|
||||
DCHECK_EQ(popup_->GetLineCount(), child_count());
|
||||
for (int i = 0; i < popup_->GetLineCount(); ++i) {
|
||||
gfx::Rect line_rect = popup_->GetRowBounds(i);
|
||||
|
||||
|
||||
DrawAutofillEntry(canvas, i, line_rect);
|
||||
}
|
||||
}
|
||||
|
@ -411,4 +411,4 @@ void AutofillPopupView::RemoveObserver() {
|
|||
views::WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(this);
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
} // namespace atom
|
||||
|
|
|
@ -57,12 +57,12 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
explicit AutofillPopupView(AutofillPopup* popup,
|
||||
views::Widget* parent_widget);
|
||||
~AutofillPopupView() override;
|
||||
|
||||
|
||||
void Show();
|
||||
void Hide();
|
||||
|
||||
|
||||
void OnSuggestionsChanged();
|
||||
|
||||
|
||||
int GetSelectedLine() { return selected_line_.value_or(-1); }
|
||||
|
||||
void WriteDragDataForView(
|
||||
|
@ -71,8 +71,8 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
return ui::DragDropTypes::DRAG_NONE;
|
||||
}
|
||||
bool CanStartDragForView(
|
||||
views::View*, const gfx::Point&, const gfx::Point&) override {
|
||||
return false;
|
||||
views::View*, const gfx::Point&, const gfx::Point&) override {
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -88,9 +88,9 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
// child views are used for accessibility events only. We need child views to
|
||||
// populate the correct |AXNodeData| when user selects a suggestion.
|
||||
void CreateChildViews();
|
||||
|
||||
|
||||
void DoUpdateBoundsAndRedrawPopup();
|
||||
|
||||
|
||||
// views::Views implementation.
|
||||
void OnPaint(gfx::Canvas* canvas) override;
|
||||
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
|
||||
|
@ -103,7 +103,7 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
void OnGestureEvent(ui::GestureEvent* event) override;
|
||||
bool AcceleratorPressed(const ui::Accelerator& accelerator) override;
|
||||
bool HandleKeyPressEvent(const content::NativeWebKeyboardEvent& event);
|
||||
|
||||
|
||||
// views::WidgetFocusChangeListener implementation.
|
||||
void OnNativeFocusChanged(gfx::NativeView focused_now) override;
|
||||
|
||||
|
@ -131,10 +131,10 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
|
||||
// The time when the popup was shown.
|
||||
base::Time show_time_;
|
||||
|
||||
|
||||
// The index of the currently selected line
|
||||
base::Optional<int> selected_line_;
|
||||
|
||||
|
||||
// The registered keypress callback, responsible for switching lines on
|
||||
// key presses
|
||||
content::RenderWidgetHost::KeyPressEventCallback keypress_callback_;
|
||||
|
@ -144,4 +144,4 @@ class AutofillPopupView : public views::WidgetDelegateView,
|
|||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_UI_VIEWS_AUTOFILL_POPUP_VIEW_H_
|
||||
#endif // ATOM_BROWSER_UI_VIEWS_AUTOFILL_POPUP_VIEW_H_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue