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 { ...@@ -81,8 +81,6 @@ class VIEWS_EXPORT ImageView : public View {
void OnBoundsChanged(const gfx::Rect& previous_bounds) override; void OnBoundsChanged(const gfx::Rect& previous_bounds) override;
void PreferredSizeChanged() override; void PreferredSizeChanged() override;
protected:
private: private:
friend class ImageViewTest; friend class ImageViewTest;
......
...@@ -55,9 +55,8 @@ class NativeViewHostAura::ClippingWindowDelegate : public aura::WindowDelegate { ...@@ -55,9 +55,8 @@ class NativeViewHostAura::ClippingWindowDelegate : public aura::WindowDelegate {
// Ask the hosted native view's delegate because directly calling // Ask the hosted native view's delegate because directly calling
// aura::Window::CanFocus() will call back into this when checking whether // aura::Window::CanFocus() will call back into this when checking whether
// parents can focus. // parents can focus.
return native_view_ && native_view_->delegate() return !native_view_ || !native_view_->delegate() ||
? native_view_->delegate()->CanFocus() native_view_->delegate()->CanFocus();
: true;
} }
void OnCaptureLost() override {} void OnCaptureLost() override {}
void OnPaint(const ui::PaintContext& context) override {} void OnPaint(const ui::PaintContext& context) override {}
......
...@@ -69,7 +69,7 @@ class ViewHierarchyChangedTestHost : public NativeViewHost { ...@@ -69,7 +69,7 @@ class ViewHierarchyChangedTestHost : public NativeViewHost {
return num_parent_changes_; return num_parent_changes_;
} }
// Overriden from NativeViewHost: // NativeViewHost:
void ViewHierarchyChanged( void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override { const ViewHierarchyChangedDetails& details) override {
gfx::NativeView parent_before = gfx::NativeView parent_before =
......
...@@ -165,9 +165,7 @@ void Slider::PrepareForMove(const int new_x) { ...@@ -165,9 +165,7 @@ void Slider::PrepareForMove(const int new_x) {
float value = GetAnimatingValue(); float value = GetAnimatingValue();
const int thumb_x = value * (content.width() - kThumbWidth); const int thumb_x = value * (content.width() - kThumbWidth);
const int candidate_x = (base::i18n::IsRTL() ? const int candidate_x = GetMirroredXInView(new_x - inset.left()) - thumb_x;
width() - (new_x - inset.left()) :
new_x - inset.left()) - thumb_x;
if (candidate_x >= 0 && candidate_x < kThumbWidth) if (candidate_x >= 0 && candidate_x < kThumbWidth)
initial_button_offset_ = candidate_x; initial_button_offset_ = candidate_x;
else else
......
...@@ -87,7 +87,7 @@ void WidgetExample::BuildButton(View* container, ...@@ -87,7 +87,7 @@ void WidgetExample::BuildButton(View* container,
} }
void WidgetExample::ShowWidget(View* sender, Widget::InitParams params) { 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.parent = sender->GetWidget()->GetNativeView();
params.bounds = gfx::Rect(sender->GetBoundsInScreen().CenterPoint(), params.bounds = gfx::Rect(sender->GetBoundsInScreen().CenterPoint(),
gfx::Size(300, 200)); gfx::Size(300, 200));
......
...@@ -18,10 +18,6 @@ ...@@ -18,10 +18,6 @@
#include "ui/views/views_export.h" #include "ui/views/views_export.h"
#include "ui/views/widget/desktop_aura/x11_desktop_handler_observer.h" #include "ui/views/widget/desktop_aura/x11_desktop_handler_observer.h"
namespace base {
template <typename T> struct DefaultSingletonTraits;
}
namespace ui { namespace ui {
class XScopedEventSelector; class XScopedEventSelector;
} }
......
...@@ -153,18 +153,17 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate, ...@@ -153,18 +153,17 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
struct VIEWS_EXPORT InitParams { struct VIEWS_EXPORT InitParams {
enum Type { enum Type {
TYPE_WINDOW, // A decorated Window, like a frame window. TYPE_WINDOW, // A decorated Window, like a frame window.
// Widgets of TYPE_WINDOW will have a NonClientView. // Widgets of TYPE_WINDOW will have a NonClientView.
TYPE_WINDOW_FRAMELESS, TYPE_WINDOW_FRAMELESS, // An undecorated Window.
// An undecorated Window. TYPE_CONTROL, // A control, like a button.
TYPE_CONTROL, // A control, like a button. TYPE_POPUP, // An undecorated Window, with transient properties.
TYPE_POPUP, // An undecorated Window, with transient properties. TYPE_MENU, // An undecorated Window, with transient properties
TYPE_MENU, // An undecorated Window, with transient properties // specialized to menus.
// specialized to menus.
TYPE_TOOLTIP, TYPE_TOOLTIP,
TYPE_BUBBLE, TYPE_BUBBLE,
TYPE_DRAG, // An undecorated Window, used during a drag-and-drop to TYPE_DRAG, // An undecorated Window, used during a drag-and-drop to
// show the drag image. // show the drag image.
}; };
enum class WindowOpacity { enum class WindowOpacity {
......
...@@ -169,11 +169,13 @@ class NestedLoopCaptureView : public View { ...@@ -169,11 +169,13 @@ class NestedLoopCaptureView : public View {
ui::WindowShowState GetWidgetShowState(const Widget* widget) { ui::WindowShowState GetWidgetShowState(const Widget* widget) {
// Use IsMaximized/IsMinimized/IsFullScreen instead of GetWindowPlacement // Use IsMaximized/IsMinimized/IsFullScreen instead of GetWindowPlacement
// because the former is implemented on all platforms but the latter is not. // because the former is implemented on all platforms but the latter is not.
return widget->IsFullscreen() ? ui::SHOW_STATE_FULLSCREEN : if (widget->IsFullscreen())
widget->IsMaximized() ? ui::SHOW_STATE_MAXIMIZED : return ui::SHOW_STATE_FULLSCREEN;
widget->IsMinimized() ? ui::SHOW_STATE_MINIMIZED : if (widget->IsMaximized())
widget->IsActive() ? ui::SHOW_STATE_NORMAL : return ui::SHOW_STATE_MAXIMIZED;
ui::SHOW_STATE_INACTIVE; 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 // 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