Commit 07c43688 authored by Peter Kasting's avatar Peter Kasting Committed by Commit Bot

Misc. cleanup found while running clang-format.

Wanted to minimize the amount of manual change in the clang-format
patch itself.

Bug: 1053845
Change-Id: I893c61571967f50d2d8a141caf72ac953000d1d3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2063899
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Thomas Lukaszewicz <tluk@chromium.org>
Reviewed-by: default avatarThomas Lukaszewicz <tluk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742659}
parent f6091b54
......@@ -81,8 +81,6 @@ class VIEWS_EXPORT ImageView : public View {
void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
void PreferredSizeChanged() override;
protected:
private:
friend class ImageViewTest;
......
......@@ -55,9 +55,8 @@ class NativeViewHostAura::ClippingWindowDelegate : public aura::WindowDelegate {
// Ask the hosted native view's delegate because directly calling
// aura::Window::CanFocus() will call back into this when checking whether
// parents can focus.
return native_view_ && native_view_->delegate()
? native_view_->delegate()->CanFocus()
: true;
return !native_view_ || !native_view_->delegate() ||
native_view_->delegate()->CanFocus();
}
void OnCaptureLost() override {}
void OnPaint(const ui::PaintContext& context) override {}
......
......@@ -69,7 +69,7 @@ class ViewHierarchyChangedTestHost : public NativeViewHost {
return num_parent_changes_;
}
// Overriden from NativeViewHost:
// NativeViewHost:
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override {
gfx::NativeView parent_before =
......
......@@ -165,9 +165,7 @@ void Slider::PrepareForMove(const int new_x) {
float value = GetAnimatingValue();
const int thumb_x = value * (content.width() - kThumbWidth);
const int candidate_x = (base::i18n::IsRTL() ?
width() - (new_x - inset.left()) :
new_x - inset.left()) - thumb_x;
const int candidate_x = GetMirroredXInView(new_x - inset.left()) - thumb_x;
if (candidate_x >= 0 && candidate_x < kThumbWidth)
initial_button_offset_ = candidate_x;
else
......
......@@ -87,7 +87,7 @@ void WidgetExample::BuildButton(View* container,
}
void WidgetExample::ShowWidget(View* sender, Widget::InitParams params) {
// Setup shared Widget heirarchy and bounds parameters.
// Setup shared Widget hierarchy and bounds parameters.
params.parent = sender->GetWidget()->GetNativeView();
params.bounds = gfx::Rect(sender->GetBoundsInScreen().CenterPoint(),
gfx::Size(300, 200));
......
......@@ -18,10 +18,6 @@
#include "ui/views/views_export.h"
#include "ui/views/widget/desktop_aura/x11_desktop_handler_observer.h"
namespace base {
template <typename T> struct DefaultSingletonTraits;
}
namespace ui {
class XScopedEventSelector;
}
......
......@@ -155,8 +155,7 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
enum Type {
TYPE_WINDOW, // A decorated Window, like a frame window.
// Widgets of TYPE_WINDOW will have a NonClientView.
TYPE_WINDOW_FRAMELESS,
// An undecorated Window.
TYPE_WINDOW_FRAMELESS, // An undecorated Window.
TYPE_CONTROL, // A control, like a button.
TYPE_POPUP, // An undecorated Window, with transient properties.
TYPE_MENU, // An undecorated Window, with transient properties
......
......@@ -169,11 +169,13 @@ class NestedLoopCaptureView : public View {
ui::WindowShowState GetWidgetShowState(const Widget* widget) {
// Use IsMaximized/IsMinimized/IsFullScreen instead of GetWindowPlacement
// because the former is implemented on all platforms but the latter is not.
return widget->IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN :
widget->IsMaximized() ? ui::SHOW_STATE_MAXIMIZED :
widget->IsMinimized() ? ui::SHOW_STATE_MINIMIZED :
widget->IsActive() ? ui::SHOW_STATE_NORMAL :
ui::SHOW_STATE_INACTIVE;
if (widget->IsFullscreen())
return ui::SHOW_STATE_FULLSCREEN;
if (widget->IsMaximized())
return ui::SHOW_STATE_MAXIMIZED;
if (widget->IsMinimized())
return ui::SHOW_STATE_MINIMIZED;
return widget->IsActive() ? ui::SHOW_STATE_NORMAL : ui::SHOW_STATE_INACTIVE;
}
// Give the OS an opportunity to process messages for an activation change, when
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment