Code formatting for imported Chromium code
This commit is contained in:
committed by
George Wright
parent
619b946ec4
commit
a219aacc41
@@ -380,43 +380,43 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
|
||||
|
||||
public:
|
||||
BEGIN_COM_MAP(AXPlatformNodeWin)
|
||||
// TODO(nektar): Change the following to COM_INTERFACE_ENTRY(IDispatch).
|
||||
COM_INTERFACE_ENTRY2(IDispatch, IAccessible2_2)
|
||||
COM_INTERFACE_ENTRY2(IUnknown, IDispatchImpl)
|
||||
// TODO(nektar): Find a way to remove the following entry because it's not
|
||||
// an interface.
|
||||
COM_INTERFACE_ENTRY(AXPlatformNodeWin)
|
||||
COM_INTERFACE_ENTRY(IAccessible)
|
||||
COM_INTERFACE_ENTRY(IAccessible2)
|
||||
COM_INTERFACE_ENTRY(IAccessible2_2)
|
||||
COM_INTERFACE_ENTRY(IAccessible2_3)
|
||||
COM_INTERFACE_ENTRY(IAccessible2_4)
|
||||
COM_INTERFACE_ENTRY(IAccessibleEx)
|
||||
COM_INTERFACE_ENTRY(IAccessibleText)
|
||||
COM_INTERFACE_ENTRY(IAccessibleHypertext)
|
||||
COM_INTERFACE_ENTRY(IAccessibleTable)
|
||||
COM_INTERFACE_ENTRY(IAccessibleTable2)
|
||||
COM_INTERFACE_ENTRY(IAccessibleTableCell)
|
||||
COM_INTERFACE_ENTRY(IAccessibleValue)
|
||||
COM_INTERFACE_ENTRY(IChromeAccessible)
|
||||
COM_INTERFACE_ENTRY(IExpandCollapseProvider)
|
||||
COM_INTERFACE_ENTRY(IGridItemProvider)
|
||||
COM_INTERFACE_ENTRY(IGridProvider)
|
||||
COM_INTERFACE_ENTRY(IInvokeProvider)
|
||||
COM_INTERFACE_ENTRY(IRangeValueProvider)
|
||||
COM_INTERFACE_ENTRY(IRawElementProviderFragment)
|
||||
COM_INTERFACE_ENTRY(IRawElementProviderSimple)
|
||||
COM_INTERFACE_ENTRY(IRawElementProviderSimple2)
|
||||
COM_INTERFACE_ENTRY(IScrollItemProvider)
|
||||
COM_INTERFACE_ENTRY(IScrollProvider)
|
||||
COM_INTERFACE_ENTRY(ISelectionItemProvider)
|
||||
COM_INTERFACE_ENTRY(ISelectionProvider)
|
||||
COM_INTERFACE_ENTRY(ITableItemProvider)
|
||||
COM_INTERFACE_ENTRY(ITableProvider)
|
||||
COM_INTERFACE_ENTRY(IToggleProvider)
|
||||
COM_INTERFACE_ENTRY(IValueProvider)
|
||||
COM_INTERFACE_ENTRY(IWindowProvider)
|
||||
COM_INTERFACE_ENTRY(IServiceProvider)
|
||||
// TODO(nektar): Change the following to COM_INTERFACE_ENTRY(IDispatch).
|
||||
COM_INTERFACE_ENTRY2(IDispatch, IAccessible2_2)
|
||||
COM_INTERFACE_ENTRY2(IUnknown, IDispatchImpl)
|
||||
// TODO(nektar): Find a way to remove the following entry because it's not
|
||||
// an interface.
|
||||
COM_INTERFACE_ENTRY(AXPlatformNodeWin)
|
||||
COM_INTERFACE_ENTRY(IAccessible)
|
||||
COM_INTERFACE_ENTRY(IAccessible2)
|
||||
COM_INTERFACE_ENTRY(IAccessible2_2)
|
||||
COM_INTERFACE_ENTRY(IAccessible2_3)
|
||||
COM_INTERFACE_ENTRY(IAccessible2_4)
|
||||
COM_INTERFACE_ENTRY(IAccessibleEx)
|
||||
COM_INTERFACE_ENTRY(IAccessibleText)
|
||||
COM_INTERFACE_ENTRY(IAccessibleHypertext)
|
||||
COM_INTERFACE_ENTRY(IAccessibleTable)
|
||||
COM_INTERFACE_ENTRY(IAccessibleTable2)
|
||||
COM_INTERFACE_ENTRY(IAccessibleTableCell)
|
||||
COM_INTERFACE_ENTRY(IAccessibleValue)
|
||||
COM_INTERFACE_ENTRY(IChromeAccessible)
|
||||
COM_INTERFACE_ENTRY(IExpandCollapseProvider)
|
||||
COM_INTERFACE_ENTRY(IGridItemProvider)
|
||||
COM_INTERFACE_ENTRY(IGridProvider)
|
||||
COM_INTERFACE_ENTRY(IInvokeProvider)
|
||||
COM_INTERFACE_ENTRY(IRangeValueProvider)
|
||||
COM_INTERFACE_ENTRY(IRawElementProviderFragment)
|
||||
COM_INTERFACE_ENTRY(IRawElementProviderSimple)
|
||||
COM_INTERFACE_ENTRY(IRawElementProviderSimple2)
|
||||
COM_INTERFACE_ENTRY(IScrollItemProvider)
|
||||
COM_INTERFACE_ENTRY(IScrollProvider)
|
||||
COM_INTERFACE_ENTRY(ISelectionItemProvider)
|
||||
COM_INTERFACE_ENTRY(ISelectionProvider)
|
||||
COM_INTERFACE_ENTRY(ITableItemProvider)
|
||||
COM_INTERFACE_ENTRY(ITableProvider)
|
||||
COM_INTERFACE_ENTRY(IToggleProvider)
|
||||
COM_INTERFACE_ENTRY(IValueProvider)
|
||||
COM_INTERFACE_ENTRY(IWindowProvider)
|
||||
COM_INTERFACE_ENTRY(IServiceProvider)
|
||||
END_COM_MAP()
|
||||
|
||||
~AXPlatformNodeWin() override;
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
#include "ui/accessibility/platform/test_ax_node_wrapper.h"
|
||||
#include "ui/base/win/atl_module.h"
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
using base::win::ScopedBstr;
|
||||
using base::win::ScopedVariant;
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
namespace ui {
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include <objbase.h>
|
||||
#include <uiautomation.h>
|
||||
#include "ax/ax_export.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "ax/ax_export.h"
|
||||
|
||||
namespace ui {
|
||||
// {3761326A-34B2-465A-835D-7A3D8F4EFB92}
|
||||
|
||||
@@ -47,9 +47,7 @@ class GFX_RANGE_EXPORT Range {
|
||||
#endif
|
||||
|
||||
// Returns a range that is invalid, which is {UINT32_MAX,UINT32_MAX}.
|
||||
static constexpr Range InvalidRange() {
|
||||
return Range(std::numeric_limits<uint32_t>::max());
|
||||
}
|
||||
static constexpr Range InvalidRange() { return Range(std::numeric_limits<uint32_t>::max()); }
|
||||
|
||||
// Checks if the range is valid through comparison to InvalidRange().
|
||||
constexpr bool IsValid() const { return *this != InvalidRange(); }
|
||||
@@ -68,27 +66,19 @@ class GFX_RANGE_EXPORT Range {
|
||||
constexpr bool is_empty() const { return start() == end(); }
|
||||
|
||||
// Returns the minimum and maximum values.
|
||||
constexpr uint32_t GetMin() const {
|
||||
return start() < end() ? start() : end();
|
||||
}
|
||||
constexpr uint32_t GetMax() const {
|
||||
return start() > end() ? start() : end();
|
||||
}
|
||||
constexpr uint32_t GetMin() const { return start() < end() ? start() : end(); }
|
||||
constexpr uint32_t GetMax() const { return start() > end() ? start() : end(); }
|
||||
|
||||
constexpr bool operator==(const Range& other) const {
|
||||
return start() == other.start() && end() == other.end();
|
||||
}
|
||||
constexpr bool operator!=(const Range& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
constexpr bool operator!=(const Range& other) const { return !(*this == other); }
|
||||
constexpr bool EqualsIgnoringDirection(const Range& other) const {
|
||||
return GetMin() == other.GetMin() && GetMax() == other.GetMax();
|
||||
}
|
||||
|
||||
// Returns true if this range intersects the specified |range|.
|
||||
constexpr bool Intersects(const Range& range) const {
|
||||
return Intersect(range).IsValid();
|
||||
}
|
||||
constexpr bool Intersects(const Range& range) const { return Intersect(range).IsValid(); }
|
||||
|
||||
// Returns true if this range contains the specified |range|.
|
||||
constexpr bool Contains(const Range& range) const {
|
||||
@@ -100,8 +90,7 @@ class GFX_RANGE_EXPORT Range {
|
||||
// Returns true if this range is contained by the specified |range| or it is
|
||||
// an empty range and ending the range |range|.
|
||||
constexpr bool IsBoundedBy(const Range& range) const {
|
||||
return IsValid() && range.IsValid() && GetMin() >= range.GetMin() &&
|
||||
GetMax() <= range.GetMax();
|
||||
return IsValid() && range.IsValid() && GetMin() >= range.GetMin() && GetMax() <= range.GetMax();
|
||||
}
|
||||
|
||||
// Computes the intersection of this range with the given |range|.
|
||||
@@ -110,9 +99,8 @@ class GFX_RANGE_EXPORT Range {
|
||||
constexpr Range Intersect(const Range& range) const {
|
||||
const uint32_t min = std::max(GetMin(), range.GetMin());
|
||||
const uint32_t max = std::min(GetMax(), range.GetMax());
|
||||
return (min < max || Contains(range) || range.Contains(*this))
|
||||
? Range(min, max)
|
||||
: InvalidRange();
|
||||
return (min < max || Contains(range) || range.Contains(*this)) ? Range(min, max)
|
||||
: InvalidRange();
|
||||
}
|
||||
|
||||
#if defined(OS_APPLE)
|
||||
|
||||
@@ -11,16 +11,13 @@
|
||||
namespace {
|
||||
|
||||
template <typename T>
|
||||
class RangeTest : public testing::Test {
|
||||
};
|
||||
class RangeTest : public testing::Test {};
|
||||
|
||||
typedef testing::Types<gfx::Range, gfx::RangeF> RangeTypes;
|
||||
TYPED_TEST_SUITE(RangeTest, RangeTypes);
|
||||
|
||||
template <typename T>
|
||||
void TestContainsAndIntersects(const T& r1,
|
||||
const T& r2,
|
||||
const T& r3) {
|
||||
void TestContainsAndIntersects(const T& r1, const T& r2, const T& r3) {
|
||||
EXPECT_TRUE(r1.Intersects(r1));
|
||||
EXPECT_TRUE(r1.Contains(r1));
|
||||
EXPECT_EQ(T(10, 12), r1.Intersect(r1));
|
||||
|
||||
Reference in New Issue
Block a user