diff --git a/ash/app_list/app_list_presenter_delegate.cc b/ash/app_list/app_list_presenter_delegate.cc index 7edb1e9..54a0daee 100644 --- a/ash/app_list/app_list_presenter_delegate.cc +++ b/ash/app_list/app_list_presenter_delegate.cc
@@ -265,8 +265,6 @@ UpdateBounds(); } -void AppListPresenterDelegate::OnKeyboardClosed() {} - //////////////////////////////////////////////////////////////////////////////// // AppListPresenterDelegate, ShellObserver implementation: void AppListPresenterDelegate::OnOverviewModeStarting() {
diff --git a/ash/app_list/app_list_presenter_delegate.h b/ash/app_list/app_list_presenter_delegate.h index eb61723..3dc3f56 100644 --- a/ash/app_list/app_list_presenter_delegate.h +++ b/ash/app_list/app_list_presenter_delegate.h
@@ -67,7 +67,6 @@ // KeyboardControllerObserver overrides: void OnKeyboardWorkspaceOccludedBoundsChanging( const gfx::Rect& new_bounds) override; - void OnKeyboardClosed() override; // ShellObserver overrides: void OnOverviewModeStarting() override;
diff --git a/ash/system/network/network_state_list_detailed_view.cc b/ash/system/network/network_state_list_detailed_view.cc index 0b5cb64c..3761b18 100644 --- a/ash/system/network/network_state_list_detailed_view.cc +++ b/ash/system/network/network_state_list_detailed_view.cc
@@ -71,7 +71,12 @@ AddChildView(content); } - ~InfoBubble() override { detailed_view_->OnInfoBubbleDestroyed(); } + ~InfoBubble() override { + // Anchor view can be destructed before info bubble is destructed. Call + // OnInfoBubbleDestroyed only if anchor view is live. + if (GetAnchorView()) + detailed_view_->OnInfoBubbleDestroyed(); + } private: // View: @@ -180,6 +185,10 @@ Layout(); } +void NetworkStateListDetailedView::ToggleInfoBubbleForTesting() { + ToggleInfoBubble(); +} + void NetworkStateListDetailedView::Init() { CreateScrollableList(); CreateTitleRow(list_type_ == ListType::LIST_TYPE_NETWORK
diff --git a/ash/system/network/network_state_list_detailed_view.h b/ash/system/network/network_state_list_detailed_view.h index 235ced1..3a8fc085 100644 --- a/ash/system/network/network_state_list_detailed_view.h +++ b/ash/system/network/network_state_list_detailed_view.h
@@ -23,7 +23,8 @@ namespace tray { -class NetworkStateListDetailedView +// Exported for tests. +class ASH_EXPORT NetworkStateListDetailedView : public TrayDetailsView, public base::SupportsWeakPtr<NetworkStateListDetailedView> { public: @@ -35,6 +36,8 @@ // Manager properties (e.g. technology state) have changed. void Update(); + void ToggleInfoBubbleForTesting(); + protected: enum ListType { LIST_TYPE_NETWORK, LIST_TYPE_VPN };
diff --git a/ash/system/network/tray_network_unittest.cc b/ash/system/network/tray_network_unittest.cc index 60c39bd4..3fbca09 100644 --- a/ash/system/network/tray_network_unittest.cc +++ b/ash/system/network/tray_network_unittest.cc
@@ -96,5 +96,26 @@ EXPECT_TRUE(MessageCenter::Get()->FindVisibleNotificationById("wifi-toggle")); } +// Open network info bubble and close network detailed view. Confirm that it +// doesn't crash. +TEST_F(TrayNetworkTest, NetworkInfoBubble) { + // Open the system tray menu. + SystemTray* system_tray = GetPrimarySystemTray(); + system_tray->ShowDefaultView(BUBBLE_CREATE_NEW, true /* show_by_click */); + RunAllPendingInMessageLoop(); + + // Show network details. + TrayNetwork* tray_network = SystemTrayTestApi(system_tray).tray_network(); + const int close_delay_in_seconds = 0; + system_tray->ShowDetailedView(tray_network, close_delay_in_seconds, + BUBBLE_USE_EXISTING); + RunAllPendingInMessageLoop(); + + // Show info bubble. + tray_network->detailed()->ToggleInfoBubbleForTesting(); + + // TearDown() should close the bubble and not crash. +} + } // namespace } // namespace ash
diff --git a/ash/system/virtual_keyboard/virtual_keyboard_tray.cc b/ash/system/virtual_keyboard/virtual_keyboard_tray.cc index 91ca0c31..6c390ddd 100644 --- a/ash/system/virtual_keyboard/virtual_keyboard_tray.cc +++ b/ash/system/virtual_keyboard/virtual_keyboard_tray.cc
@@ -100,8 +100,6 @@ SetIsActive(!new_bounds.IsEmpty()); } -void VirtualKeyboardTray::OnKeyboardClosed() {} - void VirtualKeyboardTray::OnKeyboardControllerCreated() { ObserveKeyboardController(); }
diff --git a/ash/system/virtual_keyboard/virtual_keyboard_tray.h b/ash/system/virtual_keyboard/virtual_keyboard_tray.h index 2ae272dd..a7e55f35 100644 --- a/ash/system/virtual_keyboard/virtual_keyboard_tray.h +++ b/ash/system/virtual_keyboard/virtual_keyboard_tray.h
@@ -37,7 +37,6 @@ // keyboard::KeyboardControllerObserver: void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; - void OnKeyboardClosed() override; // ShellObserver: void OnKeyboardControllerCreated() override;
diff --git a/ash/wm/system_modal_container_layout_manager.cc b/ash/wm/system_modal_container_layout_manager.cc index 5ac5d16..90c1e4f 100644 --- a/ash/wm/system_modal_container_layout_manager.cc +++ b/ash/wm/system_modal_container_layout_manager.cc
@@ -140,8 +140,6 @@ PositionDialogsAfterWorkAreaResize(); } -void SystemModalContainerLayoutManager::OnKeyboardClosed() {} - bool SystemModalContainerLayoutManager::IsPartOfActiveModalWindow( aura::Window* window) { return modal_window() &&
diff --git a/ash/wm/system_modal_container_layout_manager.h b/ash/wm/system_modal_container_layout_manager.h index fbd0bba..d3490bb 100644 --- a/ash/wm/system_modal_container_layout_manager.h +++ b/ash/wm/system_modal_container_layout_manager.h
@@ -52,7 +52,6 @@ // Overridden from keyboard::KeyboardControllerObserver: void OnKeyboardWorkspaceOccludedBoundsChanging( const gfx::Rect& new_bounds) override; - void OnKeyboardClosed() override; // True if the window is either contained by the top most modal window, // or contained by its transient children.
diff --git a/cc/animation/animation_events.cc b/cc/animation/animation_events.cc index 6e62d78..a353f22 100644 --- a/cc/animation/animation_events.cc +++ b/cc/animation/animation_events.cc
@@ -50,11 +50,11 @@ return *this; } -AnimationEvent::~AnimationEvent() {} +AnimationEvent::~AnimationEvent() = default; -AnimationEvents::AnimationEvents() {} +AnimationEvents::AnimationEvents() = default; -AnimationEvents::~AnimationEvents() {} +AnimationEvents::~AnimationEvents() = default; bool AnimationEvents::IsEmpty() const { return events_.empty();
diff --git a/cc/animation/animation_host_unittest.cc b/cc/animation/animation_host_unittest.cc index fdaefc7b..ba20b92 100644 --- a/cc/animation/animation_host_unittest.cc +++ b/cc/animation/animation_host_unittest.cc
@@ -16,8 +16,8 @@ class AnimationHostTest : public AnimationTimelinesTest { public: - AnimationHostTest() {} - ~AnimationHostTest() override {} + AnimationHostTest() = default; + ~AnimationHostTest() override = default; }; // See AnimationPlayer tests on layer registration/unregistration in
diff --git a/cc/animation/animation_player_unittest.cc b/cc/animation/animation_player_unittest.cc index 6eb366e6..95956a9 100644 --- a/cc/animation/animation_player_unittest.cc +++ b/cc/animation/animation_player_unittest.cc
@@ -19,8 +19,8 @@ class AnimationPlayerTest : public AnimationTimelinesTest { public: - AnimationPlayerTest() {} - ~AnimationPlayerTest() override {} + AnimationPlayerTest() = default; + ~AnimationPlayerTest() override = default; }; // See element_animations_unittest.cc for active/pending observers tests.
diff --git a/cc/animation/element_animations.cc b/cc/animation/element_animations.cc index 4018d3b..5f8ec65 100644 --- a/cc/animation/element_animations.cc +++ b/cc/animation/element_animations.cc
@@ -34,7 +34,7 @@ has_element_in_pending_list_(false), needs_push_properties_(false) {} -ElementAnimations::~ElementAnimations() {} +ElementAnimations::~ElementAnimations() = default; void ElementAnimations::SetAnimationHost(AnimationHost* host) { animation_host_ = host;
diff --git a/cc/animation/element_animations_unittest.cc b/cc/animation/element_animations_unittest.cc index 7b1c4ef..1467554 100644 --- a/cc/animation/element_animations_unittest.cc +++ b/cc/animation/element_animations_unittest.cc
@@ -36,8 +36,8 @@ class ElementAnimationsTest : public AnimationTimelinesTest { public: - ElementAnimationsTest() {} - ~ElementAnimationsTest() override {} + ElementAnimationsTest() = default; + ~ElementAnimationsTest() override = default; void SetUp() override { AnimationTimelinesTest::SetUp(); @@ -290,7 +290,7 @@ class TestAnimationDelegateThatDestroysPlayer : public TestAnimationDelegate { public: - TestAnimationDelegateThatDestroysPlayer() {} + TestAnimationDelegateThatDestroysPlayer() = default; void NotifyAnimationStarted(base::TimeTicks monotonic_time, int target_property,
diff --git a/cc/animation/keyframed_animation_curve.cc b/cc/animation/keyframed_animation_curve.cc index ab620f9..89f088a 100644 --- a/cc/animation/keyframed_animation_curve.cc +++ b/cc/animation/keyframed_animation_curve.cc
@@ -92,7 +92,7 @@ std::unique_ptr<TimingFunction> timing_function) : time_(time), timing_function_(std::move(timing_function)) {} -Keyframe::~Keyframe() {} +Keyframe::~Keyframe() = default; base::TimeDelta Keyframe::Time() const { return time_; @@ -111,7 +111,7 @@ std::unique_ptr<TimingFunction> timing_function) : Keyframe(time, std::move(timing_function)), value_(value) {} -ColorKeyframe::~ColorKeyframe() {} +ColorKeyframe::~ColorKeyframe() = default; SkColor ColorKeyframe::Value() const { return value_; } @@ -135,7 +135,7 @@ std::unique_ptr<TimingFunction> timing_function) : Keyframe(time, std::move(timing_function)), value_(value) {} -FloatKeyframe::~FloatKeyframe() {} +FloatKeyframe::~FloatKeyframe() = default; float FloatKeyframe::Value() const { return value_; @@ -162,7 +162,7 @@ std::unique_ptr<TimingFunction> timing_function) : Keyframe(time, std::move(timing_function)), value_(value) {} -TransformKeyframe::~TransformKeyframe() {} +TransformKeyframe::~TransformKeyframe() = default; const TransformOperations& TransformKeyframe::Value() const { return value_; @@ -188,7 +188,7 @@ std::unique_ptr<TimingFunction> timing_function) : Keyframe(time, std::move(timing_function)), value_(value) {} -FilterKeyframe::~FilterKeyframe() {} +FilterKeyframe::~FilterKeyframe() = default; const FilterOperations& FilterKeyframe::Value() const { return value_; @@ -214,7 +214,7 @@ std::unique_ptr<TimingFunction> timing_function) : Keyframe(time, std::move(timing_function)), value_(value) {} -SizeKeyframe::~SizeKeyframe() {} +SizeKeyframe::~SizeKeyframe() = default; const gfx::SizeF& SizeKeyframe::Value() const { return value_; @@ -235,7 +235,7 @@ KeyframedColorAnimationCurve::KeyframedColorAnimationCurve() : scaled_duration_(1.0) {} -KeyframedColorAnimationCurve::~KeyframedColorAnimationCurve() {} +KeyframedColorAnimationCurve::~KeyframedColorAnimationCurve() = default; void KeyframedColorAnimationCurve::AddKeyframe( std::unique_ptr<ColorKeyframe> keyframe) { @@ -286,7 +286,7 @@ KeyframedFloatAnimationCurve::KeyframedFloatAnimationCurve() : scaled_duration_(1.0) {} -KeyframedFloatAnimationCurve::~KeyframedFloatAnimationCurve() {} +KeyframedFloatAnimationCurve::~KeyframedFloatAnimationCurve() = default; void KeyframedFloatAnimationCurve::AddKeyframe( std::unique_ptr<FloatKeyframe> keyframe) { @@ -337,7 +337,7 @@ KeyframedTransformAnimationCurve::KeyframedTransformAnimationCurve() : scaled_duration_(1.0) {} -KeyframedTransformAnimationCurve::~KeyframedTransformAnimationCurve() {} +KeyframedTransformAnimationCurve::~KeyframedTransformAnimationCurve() = default; void KeyframedTransformAnimationCurve::AddKeyframe( std::unique_ptr<TransformKeyframe> keyframe) { @@ -464,7 +464,7 @@ KeyframedFilterAnimationCurve::KeyframedFilterAnimationCurve() : scaled_duration_(1.0) {} -KeyframedFilterAnimationCurve::~KeyframedFilterAnimationCurve() {} +KeyframedFilterAnimationCurve::~KeyframedFilterAnimationCurve() = default; void KeyframedFilterAnimationCurve::AddKeyframe( std::unique_ptr<FilterKeyframe> keyframe) { @@ -524,7 +524,7 @@ KeyframedSizeAnimationCurve::KeyframedSizeAnimationCurve() : scaled_duration_(1.0) {} -KeyframedSizeAnimationCurve::~KeyframedSizeAnimationCurve() {} +KeyframedSizeAnimationCurve::~KeyframedSizeAnimationCurve() = default; void KeyframedSizeAnimationCurve::AddKeyframe( std::unique_ptr<SizeKeyframe> keyframe) {
diff --git a/cc/animation/scroll_offset_animation_curve.cc b/cc/animation/scroll_offset_animation_curve.cc index c1bfe63..dad0ee2 100644 --- a/cc/animation/scroll_offset_animation_curve.cc +++ b/cc/animation/scroll_offset_animation_curve.cc
@@ -71,7 +71,7 @@ duration_behavior_(duration_behavior), has_set_initial_value_(false) {} -ScrollOffsetAnimationCurve::~ScrollOffsetAnimationCurve() {} +ScrollOffsetAnimationCurve::~ScrollOffsetAnimationCurve() = default; base::TimeDelta ScrollOffsetAnimationCurve::SegmentDuration( const gfx::Vector2dF& delta,
diff --git a/cc/animation/scroll_offset_animations.cc b/cc/animation/scroll_offset_animations.cc index 3998c89..7fb3fe9 100644 --- a/cc/animation/scroll_offset_animations.cc +++ b/cc/animation/scroll_offset_animations.cc
@@ -8,7 +8,7 @@ namespace cc { -ScrollOffsetAnimationUpdate::ScrollOffsetAnimationUpdate() {} +ScrollOffsetAnimationUpdate::ScrollOffsetAnimationUpdate() = default; ScrollOffsetAnimationUpdate::ScrollOffsetAnimationUpdate(ElementId element_id) : element_id_(element_id), takeover_(false) {} @@ -16,7 +16,7 @@ ScrollOffsetAnimations::ScrollOffsetAnimations(AnimationHost* animation_host) : animation_host_(animation_host) {} -ScrollOffsetAnimations::~ScrollOffsetAnimations() {} +ScrollOffsetAnimations::~ScrollOffsetAnimations() = default; ScrollOffsetAnimationUpdate ScrollOffsetAnimations::GetUpdateForElementId( ElementId element_id) const {
diff --git a/cc/animation/timing_function.cc b/cc/animation/timing_function.cc index e0c7577c..e3df8de 100644 --- a/cc/animation/timing_function.cc +++ b/cc/animation/timing_function.cc
@@ -12,9 +12,9 @@ namespace cc { -TimingFunction::TimingFunction() {} +TimingFunction::TimingFunction() = default; -TimingFunction::~TimingFunction() {} +TimingFunction::~TimingFunction() = default; std::unique_ptr<CubicBezierTimingFunction> CubicBezierTimingFunction::CreatePreset(EaseType ease_type) { @@ -51,7 +51,7 @@ double y2) : bezier_(x1, y1, x2, y2), ease_type_(ease_type) {} -CubicBezierTimingFunction::~CubicBezierTimingFunction() {} +CubicBezierTimingFunction::~CubicBezierTimingFunction() = default; TimingFunction::Type CubicBezierTimingFunction::GetType() const { return Type::CUBIC_BEZIER; @@ -83,8 +83,7 @@ StepsTimingFunction::StepsTimingFunction(int steps, StepPosition step_position) : steps_(steps), step_position_(step_position) {} -StepsTimingFunction::~StepsTimingFunction() { -} +StepsTimingFunction::~StepsTimingFunction() = default; TimingFunction::Type StepsTimingFunction::GetType() const { return Type::STEPS; @@ -137,7 +136,7 @@ FramesTimingFunction::FramesTimingFunction(int frames) : frames_(frames) {} -FramesTimingFunction::~FramesTimingFunction() {} +FramesTimingFunction::~FramesTimingFunction() = default; TimingFunction::Type FramesTimingFunction::GetType() const { return Type::FRAMES;
diff --git a/cc/animation/transform_operations.cc b/cc/animation/transform_operations.cc index d089252..5e4e807 100644 --- a/cc/animation/transform_operations.cc +++ b/cc/animation/transform_operations.cc
@@ -30,8 +30,7 @@ } } -TransformOperations::~TransformOperations() { -} +TransformOperations::~TransformOperations() = default; TransformOperations& TransformOperations::operator=( const TransformOperations& other) {
diff --git a/cc/animation/worklet_animation_player.cc b/cc/animation/worklet_animation_player.cc index ce7454c..0afbeff 100644 --- a/cc/animation/worklet_animation_player.cc +++ b/cc/animation/worklet_animation_player.cc
@@ -17,7 +17,7 @@ name_(name), scroll_timeline_(std::move(scroll_timeline)) {} -WorkletAnimationPlayer::~WorkletAnimationPlayer() {} +WorkletAnimationPlayer::~WorkletAnimationPlayer() = default; scoped_refptr<WorkletAnimationPlayer> WorkletAnimationPlayer::Create( int id,
diff --git a/cc/animation/worklet_animation_player_unittest.cc b/cc/animation/worklet_animation_player_unittest.cc index 100d9b8..f8dd61cd 100644 --- a/cc/animation/worklet_animation_player_unittest.cc +++ b/cc/animation/worklet_animation_player_unittest.cc
@@ -21,8 +21,8 @@ class WorkletAnimationPlayerTest : public AnimationTimelinesTest { public: - WorkletAnimationPlayerTest() {} - ~WorkletAnimationPlayerTest() override {} + WorkletAnimationPlayerTest() = default; + ~WorkletAnimationPlayerTest() override = default; int worklet_player_id_ = 11; };
diff --git a/cc/base/delayed_unique_notifier.cc b/cc/base/delayed_unique_notifier.cc index 4cdd06a..fa8da7ab 100644 --- a/cc/base/delayed_unique_notifier.cc +++ b/cc/base/delayed_unique_notifier.cc
@@ -22,8 +22,7 @@ weak_ptr_factory_(this) { } -DelayedUniqueNotifier::~DelayedUniqueNotifier() { -} +DelayedUniqueNotifier::~DelayedUniqueNotifier() = default; void DelayedUniqueNotifier::Schedule() { base::AutoLock hold(lock_);
diff --git a/cc/base/delayed_unique_notifier_unittest.cc b/cc/base/delayed_unique_notifier_unittest.cc index 52aba32a..8731cb0 100644 --- a/cc/base/delayed_unique_notifier_unittest.cc +++ b/cc/base/delayed_unique_notifier_unittest.cc
@@ -19,7 +19,7 @@ const base::Closure& closure, const base::TimeDelta& delay) : DelayedUniqueNotifier(task_runner, closure, delay) {} - ~TestNotifier() override {} + ~TestNotifier() override = default; // Overridden from DelayedUniqueNotifier: base::TimeTicks Now() const override { return now_; }
diff --git a/cc/base/histograms.cc b/cc/base/histograms.cc index 58d9aed..591f704b 100644 --- a/cc/base/histograms.cc +++ b/cc/base/histograms.cc
@@ -59,8 +59,7 @@ ScopedUMAHistogramAreaTimerBase::ScopedUMAHistogramAreaTimerBase() : area_(0) { } -ScopedUMAHistogramAreaTimerBase::~ScopedUMAHistogramAreaTimerBase() { -} +ScopedUMAHistogramAreaTimerBase::~ScopedUMAHistogramAreaTimerBase() = default; bool ScopedUMAHistogramAreaTimerBase::GetHistogramValues( Sample* time_microseconds,
diff --git a/cc/base/invalidation_region.cc b/cc/base/invalidation_region.cc index 09591562..38478b5d 100644 --- a/cc/base/invalidation_region.cc +++ b/cc/base/invalidation_region.cc
@@ -14,9 +14,9 @@ namespace cc { -InvalidationRegion::InvalidationRegion() {} +InvalidationRegion::InvalidationRegion() = default; -InvalidationRegion::~InvalidationRegion() {} +InvalidationRegion::~InvalidationRegion() = default; void InvalidationRegion::Swap(Region* region) { FinalizePendingRects();
diff --git a/cc/base/list_container_helper.cc b/cc/base/list_container_helper.cc index 9fba7eea..380ad3d 100644 --- a/cc/base/list_container_helper.cc +++ b/cc/base/list_container_helper.cc
@@ -119,7 +119,7 @@ last_list_ = storage_[last_list_index_].get(); } - ~CharAllocator() {} + ~CharAllocator() = default; void* Allocate() { if (last_list_->IsFull()) { @@ -268,10 +268,7 @@ // PositionInCharAllocator ////////////////////////////////////////////////////// ListContainerHelper::PositionInCharAllocator::PositionInCharAllocator( - const ListContainerHelper::PositionInCharAllocator& other) - : ptr_to_container(other.ptr_to_container), - vector_index(other.vector_index), - item_iterator(other.item_iterator) {} + const ListContainerHelper::PositionInCharAllocator& other) = default; ListContainerHelper::PositionInCharAllocator::PositionInCharAllocator( ListContainerHelper::CharAllocator* container, @@ -349,7 +346,7 @@ max_size_for_derived_class, num_of_elements_to_reserve_for)) {} -ListContainerHelper::~ListContainerHelper() {} +ListContainerHelper::~ListContainerHelper() = default; void ListContainerHelper::RemoveLast() { data_->RemoveLast(); @@ -497,7 +494,7 @@ : PositionInCharAllocator(container, vector_ind, item_iter), index_(index) {} -ListContainerHelper::Iterator::~Iterator() {} +ListContainerHelper::Iterator::~Iterator() = default; size_t ListContainerHelper::Iterator::index() const { return index_; @@ -516,7 +513,7 @@ : PositionInCharAllocator(container, vector_ind, item_iter), index_(index) {} -ListContainerHelper::ConstIterator::~ConstIterator() {} +ListContainerHelper::ConstIterator::~ConstIterator() = default; size_t ListContainerHelper::ConstIterator::index() const { return index_; @@ -531,7 +528,7 @@ : PositionInCharAllocator(container, vector_ind, item_iter), index_(index) {} -ListContainerHelper::ReverseIterator::~ReverseIterator() {} +ListContainerHelper::ReverseIterator::~ReverseIterator() = default; size_t ListContainerHelper::ReverseIterator::index() const { return index_; @@ -551,7 +548,7 @@ : PositionInCharAllocator(container, vector_ind, item_iter), index_(index) {} -ListContainerHelper::ConstReverseIterator::~ConstReverseIterator() {} +ListContainerHelper::ConstReverseIterator::~ConstReverseIterator() = default; size_t ListContainerHelper::ConstReverseIterator::index() const { return index_;
diff --git a/cc/base/list_container_unittest.cc b/cc/base/list_container_unittest.cc index 9753b35..f0c5a24 100644 --- a/cc/base/list_container_unittest.cc +++ b/cc/base/list_container_unittest.cc
@@ -17,7 +17,7 @@ // Element class having derived classes. class DerivedElement { public: - virtual ~DerivedElement() {} + virtual ~DerivedElement() = default; protected: bool bool_values[1]; @@ -69,8 +69,8 @@ // Element class having no derived classes. class NonDerivedElement { public: - NonDerivedElement() {} - ~NonDerivedElement() {} + NonDerivedElement() = default; + ~NonDerivedElement() = default; int int_values[1]; }; @@ -89,7 +89,7 @@ class SimpleDerivedElement : public DerivedElement { public: - ~SimpleDerivedElement() override {} + ~SimpleDerivedElement() override = default; void set_value(int val) { value = val; } int get_value() { return value; } @@ -1108,7 +1108,7 @@ class LongSimpleDerivedElement : public SimpleDerivedElement { public: - ~LongSimpleDerivedElement() override {} + ~LongSimpleDerivedElement() override = default; void SetAllValues(unsigned long value) { for (size_t i = 0; i < kLongCountForLongSimpleDerivedElement; i++) values[i] = value;
diff --git a/cc/base/region.cc b/cc/base/region.cc index 7008319..08e4051 100644 --- a/cc/base/region.cc +++ b/cc/base/region.cc
@@ -13,21 +13,17 @@ namespace cc { -Region::Region() { -} +Region::Region() = default; Region::Region(const SkRegion& region) : skregion_(region) {} -Region::Region(const Region& region) - : skregion_(region.skregion_) { -} +Region::Region(const Region& region) = default; Region::Region(const gfx::Rect& rect) : skregion_(gfx::RectToSkIRect(rect)) { } -Region::~Region() { -} +Region::~Region() = default; const Region& Region::operator=(const gfx::Rect& rect) { skregion_ = SkRegion(gfx::RectToSkIRect(rect)); @@ -154,14 +150,12 @@ } } -Region::Iterator::Iterator() { -} +Region::Iterator::Iterator() = default; Region::Iterator::Iterator(const Region& region) : it_(region.skregion_) { } -Region::Iterator::~Iterator() { -} +Region::Iterator::~Iterator() = default; } // namespace cc
diff --git a/cc/base/rolling_time_delta_history.cc b/cc/base/rolling_time_delta_history.cc index e296c4b..b790547 100644 --- a/cc/base/rolling_time_delta_history.cc +++ b/cc/base/rolling_time_delta_history.cc
@@ -13,7 +13,7 @@ RollingTimeDeltaHistory::RollingTimeDeltaHistory(size_t max_size) : max_size_(max_size) {} -RollingTimeDeltaHistory::~RollingTimeDeltaHistory() {} +RollingTimeDeltaHistory::~RollingTimeDeltaHistory() = default; void RollingTimeDeltaHistory::InsertSample(base::TimeDelta time) { if (max_size_ == 0)
diff --git a/cc/base/simple_enclosed_region.cc b/cc/base/simple_enclosed_region.cc index d3f3385..76230874 100644 --- a/cc/base/simple_enclosed_region.cc +++ b/cc/base/simple_enclosed_region.cc
@@ -24,8 +24,7 @@ Union(it.rect()); } -SimpleEnclosedRegion::~SimpleEnclosedRegion() { -} +SimpleEnclosedRegion::~SimpleEnclosedRegion() = default; void SimpleEnclosedRegion::Subtract(const gfx::Rect& sub_rect) { // We want to keep as much of the current rect as we can, so find the one
diff --git a/cc/base/tiling_data.cc b/cc/base/tiling_data.cc index edfecc9..2df754f 100644 --- a/cc/base/tiling_data.cc +++ b/cc/base/tiling_data.cc
@@ -477,8 +477,7 @@ return consider_index_rect_.left() != -1; } -TilingData::DifferenceIterator::DifferenceIterator() { -} +TilingData::DifferenceIterator::DifferenceIterator() = default; TilingData::DifferenceIterator::DifferenceIterator( const TilingData* tiling_data,
diff --git a/cc/base/unique_notifier.cc b/cc/base/unique_notifier.cc index 54cb39e..d7b59ae 100644 --- a/cc/base/unique_notifier.cc +++ b/cc/base/unique_notifier.cc
@@ -19,8 +19,7 @@ weak_ptr_factory_(this) { } -UniqueNotifier::~UniqueNotifier() { -} +UniqueNotifier::~UniqueNotifier() = default; void UniqueNotifier::Cancel() { base::AutoLock hold(lock_);
diff --git a/cc/benchmarks/invalidation_benchmark.cc b/cc/benchmarks/invalidation_benchmark.cc index f863849..35bf9cb 100644 --- a/cc/benchmarks/invalidation_benchmark.cc +++ b/cc/benchmarks/invalidation_benchmark.cc
@@ -61,7 +61,7 @@ } } -InvalidationBenchmark::~InvalidationBenchmark() {} +InvalidationBenchmark::~InvalidationBenchmark() = default; void InvalidationBenchmark::DidUpdateLayers(LayerTreeHost* layer_tree_host) { LayerTreeHostCommon::CallFunctionForEveryLayer(
diff --git a/cc/benchmarks/micro_benchmark.cc b/cc/benchmarks/micro_benchmark.cc index 456431b..8342dd36 100644 --- a/cc/benchmarks/micro_benchmark.cc +++ b/cc/benchmarks/micro_benchmark.cc
@@ -21,7 +21,7 @@ processed_for_benchmark_impl_(false), id_(0) {} -MicroBenchmark::~MicroBenchmark() {} +MicroBenchmark::~MicroBenchmark() = default; bool MicroBenchmark::IsDone() const { return is_done_;
diff --git a/cc/benchmarks/micro_benchmark_controller.cc b/cc/benchmarks/micro_benchmark_controller.cc index bd83e7e..3518600 100644 --- a/cc/benchmarks/micro_benchmark_controller.cc +++ b/cc/benchmarks/micro_benchmark_controller.cc
@@ -49,7 +49,7 @@ DCHECK(host_); } -MicroBenchmarkController::~MicroBenchmarkController() {} +MicroBenchmarkController::~MicroBenchmarkController() = default; int MicroBenchmarkController::ScheduleRun( const std::string& micro_benchmark_name,
diff --git a/cc/benchmarks/micro_benchmark_controller_impl.cc b/cc/benchmarks/micro_benchmark_controller_impl.cc index 2e53c45..56a83c7dc 100644 --- a/cc/benchmarks/micro_benchmark_controller_impl.cc +++ b/cc/benchmarks/micro_benchmark_controller_impl.cc
@@ -19,7 +19,7 @@ DCHECK(host_); } -MicroBenchmarkControllerImpl::~MicroBenchmarkControllerImpl() {} +MicroBenchmarkControllerImpl::~MicroBenchmarkControllerImpl() = default; void MicroBenchmarkControllerImpl::ScheduleRun( std::unique_ptr<MicroBenchmarkImpl> benchmark) {
diff --git a/cc/benchmarks/micro_benchmark_impl.cc b/cc/benchmarks/micro_benchmark_impl.cc index f05ebe8..11b96eb 100644 --- a/cc/benchmarks/micro_benchmark_impl.cc +++ b/cc/benchmarks/micro_benchmark_impl.cc
@@ -29,7 +29,7 @@ is_done_(false), origin_task_runner_(origin_task_runner) {} -MicroBenchmarkImpl::~MicroBenchmarkImpl() {} +MicroBenchmarkImpl::~MicroBenchmarkImpl() = default; bool MicroBenchmarkImpl::IsDone() const { return is_done_;
diff --git a/cc/benchmarks/rasterize_and_record_benchmark.cc b/cc/benchmarks/rasterize_and_record_benchmark.cc index 3efbc68..d8232e5c 100644 --- a/cc/benchmarks/rasterize_and_record_benchmark.cc +++ b/cc/benchmarks/rasterize_and_record_benchmark.cc
@@ -191,6 +191,6 @@ RasterizeAndRecordBenchmark::RecordResults::RecordResults() : pixels_recorded(0), bytes_used(0) {} -RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} +RasterizeAndRecordBenchmark::RecordResults::~RecordResults() = default; } // namespace cc
diff --git a/cc/benchmarks/rasterize_and_record_benchmark_impl.cc b/cc/benchmarks/rasterize_and_record_benchmark_impl.cc index 2fb28ba..338f9be6 100644 --- a/cc/benchmarks/rasterize_and_record_benchmark_impl.cc +++ b/cc/benchmarks/rasterize_and_record_benchmark_impl.cc
@@ -139,7 +139,7 @@ settings->GetInteger("rasterize_repeat_count", &rasterize_repeat_count_); } -RasterizeAndRecordBenchmarkImpl::~RasterizeAndRecordBenchmarkImpl() {} +RasterizeAndRecordBenchmarkImpl::~RasterizeAndRecordBenchmarkImpl() = default; void RasterizeAndRecordBenchmarkImpl::DidCompleteCommit( LayerTreeHostImpl* host) { @@ -240,6 +240,7 @@ total_picture_layers_with_no_content(0), total_picture_layers_off_screen(0) {} -RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() {} +RasterizeAndRecordBenchmarkImpl::RasterizeResults::~RasterizeResults() = + default; } // namespace cc
diff --git a/cc/benchmarks/unittest_only_benchmark_impl.cc b/cc/benchmarks/unittest_only_benchmark_impl.cc index 7bad5474..452dfae3 100644 --- a/cc/benchmarks/unittest_only_benchmark_impl.cc +++ b/cc/benchmarks/unittest_only_benchmark_impl.cc
@@ -15,7 +15,7 @@ const DoneCallback& callback) : MicroBenchmarkImpl(callback, origin_task_runner) {} -UnittestOnlyBenchmarkImpl::~UnittestOnlyBenchmarkImpl() {} +UnittestOnlyBenchmarkImpl::~UnittestOnlyBenchmarkImpl() = default; void UnittestOnlyBenchmarkImpl::DidCompleteCommit(LayerTreeHostImpl* host) { NotifyDone(nullptr);
diff --git a/cc/blink/scrollbar_impl.cc b/cc/blink/scrollbar_impl.cc index 7ee40cf..0ed7a337 100644 --- a/cc/blink/scrollbar_impl.cc +++ b/cc/blink/scrollbar_impl.cc
@@ -20,8 +20,7 @@ painter_(painter), geometry_(std::move(geometry)) {} -ScrollbarImpl::~ScrollbarImpl() { -} +ScrollbarImpl::~ScrollbarImpl() = default; cc::ScrollbarOrientation ScrollbarImpl::Orientation() const { if (scrollbar_->GetOrientation() == WebScrollbar::kHorizontal)
diff --git a/cc/blink/test/cc_blink_test_suite.cc b/cc/blink/test/cc_blink_test_suite.cc index 6202cfd3..84119a3 100644 --- a/cc/blink/test/cc_blink_test_suite.cc +++ b/cc/blink/test/cc_blink_test_suite.cc
@@ -12,7 +12,7 @@ CCBlinkTestSuite::CCBlinkTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} -CCBlinkTestSuite::~CCBlinkTestSuite() {} +CCBlinkTestSuite::~CCBlinkTestSuite() = default; void CCBlinkTestSuite::Initialize() { base::TestSuite::Initialize();
diff --git a/cc/blink/web_compositor_support_impl.cc b/cc/blink/web_compositor_support_impl.cc index d6c35fa..c3874e45e0 100644 --- a/cc/blink/web_compositor_support_impl.cc +++ b/cc/blink/web_compositor_support_impl.cc
@@ -28,11 +28,9 @@ namespace cc_blink { -WebCompositorSupportImpl::WebCompositorSupportImpl() { -} +WebCompositorSupportImpl::WebCompositorSupportImpl() = default; -WebCompositorSupportImpl::~WebCompositorSupportImpl() { -} +WebCompositorSupportImpl::~WebCompositorSupportImpl() = default; std::unique_ptr<WebLayer> WebCompositorSupportImpl::CreateLayer() { return std::make_unique<WebLayerImpl>();
diff --git a/cc/blink/web_image_layer_impl.cc b/cc/blink/web_image_layer_impl.cc index 2ba90ab8..e064000a 100644 --- a/cc/blink/web_image_layer_impl.cc +++ b/cc/blink/web_image_layer_impl.cc
@@ -15,8 +15,7 @@ layer_.reset(new WebLayerImplFixedBounds(cc::PictureImageLayer::Create())); } -WebImageLayerImpl::~WebImageLayerImpl() { -} +WebImageLayerImpl::~WebImageLayerImpl() = default; blink::WebLayer* WebImageLayerImpl::Layer() { return layer_.get();
diff --git a/cc/blink/web_layer_impl_fixed_bounds.cc b/cc/blink/web_layer_impl_fixed_bounds.cc index 46bfbcbc..aa6ccbc 100644 --- a/cc/blink/web_layer_impl_fixed_bounds.cc +++ b/cc/blink/web_layer_impl_fixed_bounds.cc
@@ -13,15 +13,13 @@ namespace cc_blink { -WebLayerImplFixedBounds::WebLayerImplFixedBounds() { -} +WebLayerImplFixedBounds::WebLayerImplFixedBounds() = default; WebLayerImplFixedBounds::WebLayerImplFixedBounds(scoped_refptr<Layer> layer) : WebLayerImpl(layer) { } -WebLayerImplFixedBounds::~WebLayerImplFixedBounds() { -} +WebLayerImplFixedBounds::~WebLayerImplFixedBounds() = default; void WebLayerImplFixedBounds::InvalidateRect(const blink::WebRect& rect) { // Partial invalidations seldom occur for such layers.
diff --git a/cc/blink/web_scrollbar_layer_impl.cc b/cc/blink/web_scrollbar_layer_impl.cc index c9cf9c30..2a2d4e1 100644 --- a/cc/blink/web_scrollbar_layer_impl.cc +++ b/cc/blink/web_scrollbar_layer_impl.cc
@@ -61,8 +61,7 @@ is_left_side_vertical_scrollbar, cc::ElementId()))) {} -WebScrollbarLayerImpl::~WebScrollbarLayerImpl() { -} +WebScrollbarLayerImpl::~WebScrollbarLayerImpl() = default; blink::WebLayer* WebScrollbarLayerImpl::Layer() { return layer_.get();
diff --git a/cc/debug/layer_tree_debug_state.cc b/cc/debug/layer_tree_debug_state.cc index ea20e3f..56b8879 100644 --- a/cc/debug/layer_tree_debug_state.cc +++ b/cc/debug/layer_tree_debug_state.cc
@@ -29,7 +29,7 @@ LayerTreeDebugState::LayerTreeDebugState(const LayerTreeDebugState& other) = default; -LayerTreeDebugState::~LayerTreeDebugState() {} +LayerTreeDebugState::~LayerTreeDebugState() = default; void LayerTreeDebugState::SetRecordRenderingStats(bool enabled) { record_rendering_stats_ = enabled;
diff --git a/cc/debug/rendering_stats.cc b/cc/debug/rendering_stats.cc index c17edb4..5bf25ac 100644 --- a/cc/debug/rendering_stats.cc +++ b/cc/debug/rendering_stats.cc
@@ -6,14 +6,12 @@ namespace cc { -RenderingStats::TimeDeltaList::TimeDeltaList() { -} +RenderingStats::TimeDeltaList::TimeDeltaList() = default; RenderingStats::TimeDeltaList::TimeDeltaList(const TimeDeltaList& other) = default; -RenderingStats::TimeDeltaList::~TimeDeltaList() { -} +RenderingStats::TimeDeltaList::~TimeDeltaList() = default; void RenderingStats::TimeDeltaList::Append(base::TimeDelta value) { values.push_back(value); @@ -47,8 +45,7 @@ RenderingStats::RenderingStats(const RenderingStats& other) = default; -RenderingStats::~RenderingStats() { -} +RenderingStats::~RenderingStats() = default; std::unique_ptr<base::trace_event::ConvertableToTraceFormat> RenderingStats::AsTraceableData() const {
diff --git a/cc/debug/rendering_stats_instrumentation.cc b/cc/debug/rendering_stats_instrumentation.cc index e74b939..967f3a10 100644 --- a/cc/debug/rendering_stats_instrumentation.cc +++ b/cc/debug/rendering_stats_instrumentation.cc
@@ -20,7 +20,7 @@ : record_rendering_stats_(false) { } -RenderingStatsInstrumentation::~RenderingStatsInstrumentation() {} +RenderingStatsInstrumentation::~RenderingStatsInstrumentation() = default; RenderingStats RenderingStatsInstrumentation::TakeImplThreadRenderingStats() { base::AutoLock scoped_lock(lock_);
diff --git a/cc/input/browser_controls_offset_manager.cc b/cc/input/browser_controls_offset_manager.cc index 7d34cc3..33ce93f 100644 --- a/cc/input/browser_controls_offset_manager.cc +++ b/cc/input/browser_controls_offset_manager.cc
@@ -51,7 +51,7 @@ CHECK(client_); } -BrowserControlsOffsetManager::~BrowserControlsOffsetManager() {} +BrowserControlsOffsetManager::~BrowserControlsOffsetManager() = default; float BrowserControlsOffsetManager::ControlsTopOffset() const { return ContentTopOffset() - TopControlsHeight();
diff --git a/cc/input/browser_controls_offset_manager_unittest.cc b/cc/input/browser_controls_offset_manager_unittest.cc index 9493480..7f039cd 100644 --- a/cc/input/browser_controls_offset_manager_unittest.cc +++ b/cc/input/browser_controls_offset_manager_unittest.cc
@@ -44,7 +44,7 @@ root_scroll_layer_ = LayerImpl::Create(active_tree_.get(), 1); } - ~MockBrowserControlsOffsetManagerClient() override {} + ~MockBrowserControlsOffsetManagerClient() override = default; void DidChangeBrowserControlsPosition() override { redraw_needed_ = true;
diff --git a/cc/input/layer_selection_bound.cc b/cc/input/layer_selection_bound.cc index 1799f77e..521cd653 100644 --- a/cc/input/layer_selection_bound.cc +++ b/cc/input/layer_selection_bound.cc
@@ -10,8 +10,7 @@ LayerSelectionBound::LayerSelectionBound() : type(gfx::SelectionBound::EMPTY), layer_id(0), hidden(false) {} -LayerSelectionBound::~LayerSelectionBound() { -} +LayerSelectionBound::~LayerSelectionBound() = default; bool LayerSelectionBound::operator==(const LayerSelectionBound& other) const { return type == other.type && layer_id == other.layer_id &&
diff --git a/cc/input/page_scale_animation.cc b/cc/input/page_scale_animation.cc index 5ed3083..fa059d30 100644 --- a/cc/input/page_scale_animation.cc +++ b/cc/input/page_scale_animation.cc
@@ -68,7 +68,7 @@ // Easing constants experimentally determined. timing_function_(.8, 0, .3, .9) {} -PageScaleAnimation::~PageScaleAnimation() {} +PageScaleAnimation::~PageScaleAnimation() = default; void PageScaleAnimation::ZoomTo(const gfx::Vector2dF& target_scroll_offset, float target_page_scale_factor,
diff --git a/cc/input/scroll_elasticity_helper.cc b/cc/input/scroll_elasticity_helper.cc index 3a54972..11d1393 100644 --- a/cc/input/scroll_elasticity_helper.cc +++ b/cc/input/scroll_elasticity_helper.cc
@@ -32,8 +32,7 @@ LayerTreeHostImpl* layer_tree) : host_impl_(layer_tree) {} -ScrollElasticityHelperImpl::~ScrollElasticityHelperImpl() { -} +ScrollElasticityHelperImpl::~ScrollElasticityHelperImpl() = default; bool ScrollElasticityHelperImpl::IsUserScrollable() const { const auto* scroll_node = host_impl_->OuterViewportScrollNode();
diff --git a/cc/input/scroll_state.cc b/cc/input/scroll_state.cc index 7d0becde..e578c325 100644 --- a/cc/input/scroll_state.cc +++ b/cc/input/scroll_state.cc
@@ -16,7 +16,7 @@ ScrollState::ScrollState(const ScrollState& other) = default; -ScrollState::~ScrollState() {} +ScrollState::~ScrollState() = default; void ScrollState::ConsumeDelta(double x, double y) { data_.delta_x -= x;
diff --git a/cc/input/scrollbar_animation_controller.cc b/cc/input/scrollbar_animation_controller.cc index 6234d3c..5f469a21 100644 --- a/cc/input/scrollbar_animation_controller.cc +++ b/cc/input/scrollbar_animation_controller.cc
@@ -85,7 +85,7 @@ thinning_duration); } -ScrollbarAnimationController::~ScrollbarAnimationController() {} +ScrollbarAnimationController::~ScrollbarAnimationController() = default; ScrollbarSet ScrollbarAnimationController::Scrollbars() const { return client_->ScrollbarsFor(scroll_element_id_);
diff --git a/cc/input/scrollbar_animation_controller_unittest.cc b/cc/input/scrollbar_animation_controller_unittest.cc index 19fea25..b142096e 100644 --- a/cc/input/scrollbar_animation_controller_unittest.cc +++ b/cc/input/scrollbar_animation_controller_unittest.cc
@@ -35,7 +35,7 @@ public: explicit MockScrollbarAnimationControllerClient(LayerTreeHostImpl* host_impl) : host_impl_(host_impl) {} - virtual ~MockScrollbarAnimationControllerClient() {} + virtual ~MockScrollbarAnimationControllerClient() = default; void PostDelayedScrollbarAnimationTask(const base::Closure& start_fade, base::TimeDelta delay) override {
diff --git a/cc/input/single_scrollbar_animation_controller_thinning_unittest.cc b/cc/input/single_scrollbar_animation_controller_thinning_unittest.cc index 970afe6..b883b1d0 100644 --- a/cc/input/single_scrollbar_animation_controller_thinning_unittest.cc +++ b/cc/input/single_scrollbar_animation_controller_thinning_unittest.cc
@@ -35,7 +35,7 @@ explicit MockSingleScrollbarAnimationControllerClient( LayerTreeHostImpl* host_impl) : host_impl_(host_impl) {} - virtual ~MockSingleScrollbarAnimationControllerClient() {} + virtual ~MockSingleScrollbarAnimationControllerClient() = default; ScrollbarSet ScrollbarsFor(ElementId scroll_element_id) const override { return host_impl_->ScrollbarsFor(scroll_element_id);
diff --git a/cc/layers/draw_properties.cc b/cc/layers/draw_properties.cc index 28226dca..0cff499 100644 --- a/cc/layers/draw_properties.cc +++ b/cc/layers/draw_properties.cc
@@ -11,6 +11,6 @@ screen_space_transform_is_animating(false), is_clipped(false) {} -DrawProperties::~DrawProperties() {} +DrawProperties::~DrawProperties() = default; } // namespace cc
diff --git a/cc/layers/effect_tree_layer_list_iterator.cc b/cc/layers/effect_tree_layer_list_iterator.cc index 340fb94..dad09611 100644 --- a/cc/layers/effect_tree_layer_list_iterator.cc +++ b/cc/layers/effect_tree_layer_list_iterator.cc
@@ -40,7 +40,7 @@ EffectTreeLayerListIterator::EffectTreeLayerListIterator( const EffectTreeLayerListIterator& iterator) = default; -EffectTreeLayerListIterator::~EffectTreeLayerListIterator() {} +EffectTreeLayerListIterator::~EffectTreeLayerListIterator() = default; void EffectTreeLayerListIterator::operator++() { switch (state_) {
diff --git a/cc/layers/effect_tree_layer_list_iterator_unittest.cc b/cc/layers/effect_tree_layer_list_iterator_unittest.cc index 71fc0fc2..7f79eb9 100644 --- a/cc/layers/effect_tree_layer_list_iterator_unittest.cc +++ b/cc/layers/effect_tree_layer_list_iterator_unittest.cc
@@ -24,7 +24,7 @@ static std::unique_ptr<TestLayerImpl> Create(LayerTreeImpl* tree, int id) { return base::WrapUnique(new TestLayerImpl(tree, id)); } - ~TestLayerImpl() override {} + ~TestLayerImpl() override = default; int count_;
diff --git a/cc/layers/heads_up_display_layer.cc b/cc/layers/heads_up_display_layer.cc index de216cf7..a07431e 100644 --- a/cc/layers/heads_up_display_layer.cc +++ b/cc/layers/heads_up_display_layer.cc
@@ -27,7 +27,7 @@ UpdateDrawsContent(HasDrawableContent()); } -HeadsUpDisplayLayer::~HeadsUpDisplayLayer() {} +HeadsUpDisplayLayer::~HeadsUpDisplayLayer() = default; void HeadsUpDisplayLayer::PrepareForCalculateDrawProperties( const gfx::Size& device_viewport, float device_scale_factor) {
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc index 224f987..ccb58e7 100644 --- a/cc/layers/heads_up_display_layer_impl.cc +++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -79,7 +79,7 @@ paint_time_graph_(16.0, 48.0), fade_step_(0) {} -HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() {} +HeadsUpDisplayLayerImpl::~HeadsUpDisplayLayerImpl() = default; std::unique_ptr<LayerImpl> HeadsUpDisplayLayerImpl::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/heads_up_display_unittest.cc b/cc/layers/heads_up_display_unittest.cc index 2ee1c72..b1e7368d 100644 --- a/cc/layers/heads_up_display_unittest.cc +++ b/cc/layers/heads_up_display_unittest.cc
@@ -26,8 +26,8 @@ bool DrawsContent() const override { return true; } private: - DrawsContentLayer() {} - ~DrawsContentLayer() override {} + DrawsContentLayer() = default; + ~DrawsContentLayer() override = default; }; class HudWithRootLayerChange : public HeadsUpDisplayTest {
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc index 75e485c4..9106ac95 100644 --- a/cc/layers/layer.cc +++ b/cc/layers/layer.cc
@@ -68,7 +68,7 @@ client(nullptr), overscroll_behavior(OverscrollBehavior::kOverscrollBehaviorTypeAuto) {} -Layer::Inputs::~Inputs() {} +Layer::Inputs::~Inputs() = default; scoped_refptr<Layer> Layer::Create() { return base::WrapRefCounted(new Layer());
diff --git a/cc/layers/layer_impl_test_properties.cc b/cc/layers/layer_impl_test_properties.cc index 6007483..c3de6974a 100644 --- a/cc/layers/layer_impl_test_properties.cc +++ b/cc/layers/layer_impl_test_properties.cc
@@ -30,7 +30,7 @@ parent(nullptr), overscroll_behavior(OverscrollBehavior()) {} -LayerImplTestProperties::~LayerImplTestProperties() {} +LayerImplTestProperties::~LayerImplTestProperties() = default; void LayerImplTestProperties::AddChild(std::unique_ptr<LayerImpl> child) { child->test_properties()->parent = owning_layer;
diff --git a/cc/layers/layer_list_iterator.cc b/cc/layers/layer_list_iterator.cc index 1713be6..1637b842 100644 --- a/cc/layers/layer_list_iterator.cc +++ b/cc/layers/layer_list_iterator.cc
@@ -44,7 +44,7 @@ const LayerListIterator<LayerType>& other) = default; template <typename LayerType> -LayerListIterator<LayerType>::~LayerListIterator() {} +LayerListIterator<LayerType>::~LayerListIterator() = default; template <typename LayerType> LayerListIterator<LayerType>& LayerListIterator<LayerType>::operator++() { @@ -85,7 +85,7 @@ } template <typename LayerType> -LayerListReverseIterator<LayerType>::~LayerListReverseIterator() {} +LayerListReverseIterator<LayerType>::~LayerListReverseIterator() = default; // We will only support prefix increment. template <typename LayerType>
diff --git a/cc/layers/layer_position_constraint_unittest.cc b/cc/layers/layer_position_constraint_unittest.cc index 0b3be1b..aa03cc5 100644 --- a/cc/layers/layer_position_constraint_unittest.cc +++ b/cc/layers/layer_position_constraint_unittest.cc
@@ -22,12 +22,12 @@ class LayerWithForcedDrawsContent : public Layer { public: - LayerWithForcedDrawsContent() {} + LayerWithForcedDrawsContent() = default; bool DrawsContent() const override; private: - ~LayerWithForcedDrawsContent() override {} + ~LayerWithForcedDrawsContent() override = default; }; bool LayerWithForcedDrawsContent::DrawsContent() const {
diff --git a/cc/layers/layer_sticky_position_constraint.cc b/cc/layers/layer_sticky_position_constraint.cc index 641f5986..cdf94c52 100644 --- a/cc/layers/layer_sticky_position_constraint.cc +++ b/cc/layers/layer_sticky_position_constraint.cc
@@ -22,24 +22,7 @@ nearest_element_shifting_containing_block(kInvalidElementId) {} LayerStickyPositionConstraint::LayerStickyPositionConstraint( - const LayerStickyPositionConstraint& other) - : is_sticky(other.is_sticky), - is_anchored_left(other.is_anchored_left), - is_anchored_right(other.is_anchored_right), - is_anchored_top(other.is_anchored_top), - is_anchored_bottom(other.is_anchored_bottom), - left_offset(other.left_offset), - right_offset(other.right_offset), - top_offset(other.top_offset), - bottom_offset(other.bottom_offset), - scroll_container_relative_sticky_box_rect( - other.scroll_container_relative_sticky_box_rect), - scroll_container_relative_containing_block_rect( - other.scroll_container_relative_containing_block_rect), - nearest_element_shifting_sticky_box( - other.nearest_element_shifting_sticky_box), - nearest_element_shifting_containing_block( - other.nearest_element_shifting_containing_block) {} + const LayerStickyPositionConstraint& other) = default; bool LayerStickyPositionConstraint::operator==( const LayerStickyPositionConstraint& other) const {
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc index a945afdf..2f633b1 100644 --- a/cc/layers/layer_unittest.cc +++ b/cc/layers/layer_unittest.cc
@@ -1282,7 +1282,7 @@ private: DrawsContentChangeLayer() : fake_draws_content_(false) {} - ~DrawsContentChangeLayer() override {} + ~DrawsContentChangeLayer() override = default; bool fake_draws_content_; };
diff --git a/cc/layers/nine_patch_layer.cc b/cc/layers/nine_patch_layer.cc index b2555fb..d17ad28 100644 --- a/cc/layers/nine_patch_layer.cc +++ b/cc/layers/nine_patch_layer.cc
@@ -19,7 +19,7 @@ NinePatchLayer::NinePatchLayer() : UIResourceLayer(), fill_center_(false), nearest_neighbor_(false) {} -NinePatchLayer::~NinePatchLayer() {} +NinePatchLayer::~NinePatchLayer() = default; std::unique_ptr<LayerImpl> NinePatchLayer::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/nine_patch_layer_impl.cc b/cc/layers/nine_patch_layer_impl.cc index 9414591..9e6c800 100644 --- a/cc/layers/nine_patch_layer_impl.cc +++ b/cc/layers/nine_patch_layer_impl.cc
@@ -18,7 +18,7 @@ NinePatchLayerImpl::NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id) : UIResourceLayerImpl(tree_impl, id) {} -NinePatchLayerImpl::~NinePatchLayerImpl() {} +NinePatchLayerImpl::~NinePatchLayerImpl() = default; std::unique_ptr<LayerImpl> NinePatchLayerImpl::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/painted_overlay_scrollbar_layer.cc b/cc/layers/painted_overlay_scrollbar_layer.cc index c81cf6e..a578eaf 100644 --- a/cc/layers/painted_overlay_scrollbar_layer.cc +++ b/cc/layers/painted_overlay_scrollbar_layer.cc
@@ -47,7 +47,7 @@ DCHECK(scrollbar_->UsesNinePatchThumbResource()); } -PaintedOverlayScrollbarLayer::~PaintedOverlayScrollbarLayer() {} +PaintedOverlayScrollbarLayer::~PaintedOverlayScrollbarLayer() = default; void PaintedOverlayScrollbarLayer::SetScrollElementId(ElementId element_id) { if (element_id == scroll_element_id_)
diff --git a/cc/layers/painted_overlay_scrollbar_layer_impl.cc b/cc/layers/painted_overlay_scrollbar_layer_impl.cc index fbbd8fa..cd24f21 100644 --- a/cc/layers/painted_overlay_scrollbar_layer_impl.cc +++ b/cc/layers/painted_overlay_scrollbar_layer_impl.cc
@@ -32,7 +32,7 @@ track_start_(0), track_length_(0) {} -PaintedOverlayScrollbarLayerImpl::~PaintedOverlayScrollbarLayerImpl() {} +PaintedOverlayScrollbarLayerImpl::~PaintedOverlayScrollbarLayerImpl() = default; std::unique_ptr<LayerImpl> PaintedOverlayScrollbarLayerImpl::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/painted_scrollbar_layer.cc b/cc/layers/painted_scrollbar_layer.cc index 170e6330..1271f8a 100644 --- a/cc/layers/painted_scrollbar_layer.cc +++ b/cc/layers/painted_scrollbar_layer.cc
@@ -59,7 +59,7 @@ MainThreadScrollingReason::kScrollbarScrolling); } -PaintedScrollbarLayer::~PaintedScrollbarLayer() {} +PaintedScrollbarLayer::~PaintedScrollbarLayer() = default; void PaintedScrollbarLayer::SetScrollElementId(ElementId element_id) { if (element_id == scroll_element_id_)
diff --git a/cc/layers/painted_scrollbar_layer_impl.cc b/cc/layers/painted_scrollbar_layer_impl.cc index dc29d3c..758cf62d 100644 --- a/cc/layers/painted_scrollbar_layer_impl.cc +++ b/cc/layers/painted_scrollbar_layer_impl.cc
@@ -48,7 +48,7 @@ track_start_(0), track_length_(0) {} -PaintedScrollbarLayerImpl::~PaintedScrollbarLayerImpl() {} +PaintedScrollbarLayerImpl::~PaintedScrollbarLayerImpl() = default; std::unique_ptr<LayerImpl> PaintedScrollbarLayerImpl::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc index 70169bc..563de65 100644 --- a/cc/layers/picture_layer.cc +++ b/cc/layers/picture_layer.cc
@@ -40,8 +40,7 @@ recording_source_ = std::move(source); } -PictureLayer::~PictureLayer() { -} +PictureLayer::~PictureLayer() = default; std::unique_ptr<LayerImpl> PictureLayer::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/recording_source.cc b/cc/layers/recording_source.cc index 423603c..c33ad76 100644 --- a/cc/layers/recording_source.cc +++ b/cc/layers/recording_source.cc
@@ -41,7 +41,7 @@ background_color_(SK_ColorTRANSPARENT), recording_scale_factor_(1.f) {} -RecordingSource::~RecordingSource() {} +RecordingSource::~RecordingSource() = default; void RecordingSource::UpdateInvalidationForNewViewport( const gfx::Rect& old_recorded_viewport,
diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc index 36704e0f..c0614fc 100644 --- a/cc/layers/render_surface_impl.cc +++ b/cc/layers/render_surface_impl.cc
@@ -47,7 +47,7 @@ damage_tracker_ = DamageTracker::Create(); } -RenderSurfaceImpl::~RenderSurfaceImpl() {} +RenderSurfaceImpl::~RenderSurfaceImpl() = default; RenderSurfaceImpl* RenderSurfaceImpl::render_target() { EffectTree& effect_tree = layer_tree_impl_->property_trees()->effect_tree; @@ -73,7 +73,7 @@ is_clipped = false; } -RenderSurfaceImpl::DrawProperties::~DrawProperties() {} +RenderSurfaceImpl::DrawProperties::~DrawProperties() = default; gfx::RectF RenderSurfaceImpl::DrawableContentRect() const { if (content_rect().IsEmpty())
diff --git a/cc/layers/solid_color_layer.cc b/cc/layers/solid_color_layer.cc index aa6dfa2e..ad4e6dc 100644 --- a/cc/layers/solid_color_layer.cc +++ b/cc/layers/solid_color_layer.cc
@@ -17,9 +17,9 @@ return base::WrapRefCounted(new SolidColorLayer()); } -SolidColorLayer::SolidColorLayer() {} +SolidColorLayer::SolidColorLayer() = default; -SolidColorLayer::~SolidColorLayer() {} +SolidColorLayer::~SolidColorLayer() = default; void SolidColorLayer::SetBackgroundColor(SkColor color) { SetContentsOpaque(SkColorGetA(color) == 255);
diff --git a/cc/layers/solid_color_layer_impl.cc b/cc/layers/solid_color_layer_impl.cc index bfdc2322..bec16b85 100644 --- a/cc/layers/solid_color_layer_impl.cc +++ b/cc/layers/solid_color_layer_impl.cc
@@ -21,7 +21,7 @@ : LayerImpl(tree_impl, id) { } -SolidColorLayerImpl::~SolidColorLayerImpl() {} +SolidColorLayerImpl::~SolidColorLayerImpl() = default; std::unique_ptr<LayerImpl> SolidColorLayerImpl::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/solid_color_scrollbar_layer.cc b/cc/layers/solid_color_scrollbar_layer.cc index baf582db..98e290d 100644 --- a/cc/layers/solid_color_scrollbar_layer.cc +++ b/cc/layers/solid_color_scrollbar_layer.cc
@@ -62,7 +62,7 @@ Layer::SetOpacity(0.f); } -SolidColorScrollbarLayer::~SolidColorScrollbarLayer() {} +SolidColorScrollbarLayer::~SolidColorScrollbarLayer() = default; ScrollbarLayerInterface* SolidColorScrollbarLayer::ToScrollbarLayer() { return this;
diff --git a/cc/layers/surface_layer.cc b/cc/layers/surface_layer.cc index 06c809a..20ad2b0f 100644 --- a/cc/layers/surface_layer.cc +++ b/cc/layers/surface_layer.cc
@@ -27,7 +27,7 @@ : reference_returner_(reference_returner), main_task_runner_(std::move(main_task_runner)) {} - ~SatisfySwapPromise() override {} + ~SatisfySwapPromise() override = default; private: void DidActivate() override {}
diff --git a/cc/layers/surface_layer_impl.cc b/cc/layers/surface_layer_impl.cc index ecd58434..6fe043b 100644 --- a/cc/layers/surface_layer_impl.cc +++ b/cc/layers/surface_layer_impl.cc
@@ -19,7 +19,7 @@ SurfaceLayerImpl::SurfaceLayerImpl(LayerTreeImpl* tree_impl, int id) : LayerImpl(tree_impl, id) {} -SurfaceLayerImpl::~SurfaceLayerImpl() {} +SurfaceLayerImpl::~SurfaceLayerImpl() = default; std::unique_ptr<LayerImpl> SurfaceLayerImpl::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/surface_layer_unittest.cc b/cc/layers/surface_layer_unittest.cc index b5c075d..555d56b 100644 --- a/cc/layers/surface_layer_unittest.cc +++ b/cc/layers/surface_layer_unittest.cc
@@ -78,7 +78,7 @@ class MockSurfaceReferenceFactory : public viz::SequenceSurfaceReferenceFactory { public: - MockSurfaceReferenceFactory() {} + MockSurfaceReferenceFactory() = default; // SequenceSurfaceReferenceFactory implementation. MOCK_CONST_METHOD1(SatisfySequence, void(const viz::SurfaceSequence&));
diff --git a/cc/layers/texture_layer_unittest.cc b/cc/layers/texture_layer_unittest.cc index 921d6c2..e946142f 100644 --- a/cc/layers/texture_layer_unittest.cc +++ b/cc/layers/texture_layer_unittest.cc
@@ -218,7 +218,7 @@ using TextureLayer::TransferableResourceHolder::Create; protected: - ~TestMailboxHolder() override {} + ~TestMailboxHolder() override = default; }; class TextureLayerWithResourceTest : public TextureLayerTest {
diff --git a/cc/layers/ui_resource_layer.cc b/cc/layers/ui_resource_layer.cc index 150422af..b95ca27b 100644 --- a/cc/layers/ui_resource_layer.cc +++ b/cc/layers/ui_resource_layer.cc
@@ -26,7 +26,7 @@ vertex_opacity_[3] = 1.0f; } -UIResourceLayer::~UIResourceLayer() {} +UIResourceLayer::~UIResourceLayer() = default; std::unique_ptr<LayerImpl> UIResourceLayer::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/ui_resource_layer_impl.cc b/cc/layers/ui_resource_layer_impl.cc index e0f12520..9821c27a 100644 --- a/cc/layers/ui_resource_layer_impl.cc +++ b/cc/layers/ui_resource_layer_impl.cc
@@ -25,7 +25,7 @@ vertex_opacity_[3] = 1.0f; } -UIResourceLayerImpl::~UIResourceLayerImpl() {} +UIResourceLayerImpl::~UIResourceLayerImpl() = default; std::unique_ptr<LayerImpl> UIResourceLayerImpl::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/layers/ui_resource_layer_unittest.cc b/cc/layers/ui_resource_layer_unittest.cc index b7b23fa..87a21390 100644 --- a/cc/layers/ui_resource_layer_unittest.cc +++ b/cc/layers/ui_resource_layer_unittest.cc
@@ -36,7 +36,7 @@ protected: TestUIResourceLayer() : UIResourceLayer() { SetIsDrawable(true); } - ~TestUIResourceLayer() override {} + ~TestUIResourceLayer() override = default; }; class UIResourceLayerTest : public testing::Test {
diff --git a/cc/layers/video_layer.cc b/cc/layers/video_layer.cc index 8f442809..1c656ecc 100644 --- a/cc/layers/video_layer.cc +++ b/cc/layers/video_layer.cc
@@ -21,7 +21,7 @@ DCHECK(provider_); } -VideoLayer::~VideoLayer() {} +VideoLayer::~VideoLayer() = default; std::unique_ptr<LayerImpl> VideoLayer::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/output/overlay_candidate.cc b/cc/output/overlay_candidate.cc index 8fb65c2..af2aa05 100644 --- a/cc/output/overlay_candidate.cc +++ b/cc/output/overlay_candidate.cc
@@ -190,7 +190,7 @@ OverlayCandidate::OverlayCandidate(const OverlayCandidate& other) = default; -OverlayCandidate::~OverlayCandidate() {} +OverlayCandidate::~OverlayCandidate() = default; // static bool OverlayCandidate::FromDrawQuad(DisplayResourceProvider* resource_provider, @@ -365,7 +365,7 @@ return true; } -OverlayCandidateList::OverlayCandidateList() {} +OverlayCandidateList::OverlayCandidateList() = default; OverlayCandidateList::OverlayCandidateList(const OverlayCandidateList& other) = default; @@ -373,7 +373,7 @@ OverlayCandidateList::OverlayCandidateList(OverlayCandidateList&& other) = default; -OverlayCandidateList::~OverlayCandidateList() {} +OverlayCandidateList::~OverlayCandidateList() = default; OverlayCandidateList& OverlayCandidateList::operator=( const OverlayCandidateList& other) = default;
diff --git a/cc/paint/filter_operation.cc b/cc/paint/filter_operation.cc index d9b6e7b..221dd572 100644 --- a/cc/paint/filter_operation.cc +++ b/cc/paint/filter_operation.cc
@@ -147,7 +147,7 @@ memcpy(matrix_, other.matrix_, sizeof(matrix_)); } -FilterOperation::~FilterOperation() {} +FilterOperation::~FilterOperation() = default; static FilterOperation CreateNoOpFilter(FilterOperation::FilterType type) { switch (type) {
diff --git a/cc/paint/filter_operations.cc b/cc/paint/filter_operations.cc index 6b42ae4..cc2dcc5 100644 --- a/cc/paint/filter_operations.cc +++ b/cc/paint/filter_operations.cc
@@ -16,20 +16,17 @@ namespace cc { -FilterOperations::FilterOperations() {} +FilterOperations::FilterOperations() = default; -FilterOperations::FilterOperations(const FilterOperations& other) - : operations_(other.operations_) {} +FilterOperations::FilterOperations(const FilterOperations& other) = default; FilterOperations::FilterOperations(std::vector<FilterOperation>&& operations) : operations_(std::move(operations)) {} -FilterOperations::~FilterOperations() {} +FilterOperations::~FilterOperations() = default; -FilterOperations& FilterOperations::operator=(const FilterOperations& other) { - operations_ = other.operations_; - return *this; -} +FilterOperations& FilterOperations::operator=(const FilterOperations& other) = + default; FilterOperations& FilterOperations::operator=(FilterOperations&& other) { operations_ = std::move(other.operations_);
diff --git a/cc/raster/bitmap_raster_buffer_provider.cc b/cc/raster/bitmap_raster_buffer_provider.cc index a25e36ed..15d6872 100644 --- a/cc/raster/bitmap_raster_buffer_provider.cc +++ b/cc/raster/bitmap_raster_buffer_provider.cc
@@ -78,7 +78,7 @@ LayerTreeResourceProvider* resource_provider) : resource_provider_(resource_provider) {} -BitmapRasterBufferProvider::~BitmapRasterBufferProvider() {} +BitmapRasterBufferProvider::~BitmapRasterBufferProvider() = default; std::unique_ptr<RasterBuffer> BitmapRasterBufferProvider::AcquireBufferForRaster(
diff --git a/cc/raster/raster_buffer.cc b/cc/raster/raster_buffer.cc index 390fbd6c..b23fe54b 100644 --- a/cc/raster/raster_buffer.cc +++ b/cc/raster/raster_buffer.cc
@@ -6,10 +6,8 @@ namespace cc { -RasterBuffer::RasterBuffer() { -} +RasterBuffer::RasterBuffer() = default; -RasterBuffer::~RasterBuffer() { -} +RasterBuffer::~RasterBuffer() = default; } // namespace cc
diff --git a/cc/raster/raster_buffer_provider.cc b/cc/raster/raster_buffer_provider.cc index 081aaf5..d11ae43 100644 --- a/cc/raster/raster_buffer_provider.cc +++ b/cc/raster/raster_buffer_provider.cc
@@ -18,9 +18,9 @@ namespace cc { -RasterBufferProvider::RasterBufferProvider() {} +RasterBufferProvider::RasterBufferProvider() = default; -RasterBufferProvider::~RasterBufferProvider() {} +RasterBufferProvider::~RasterBufferProvider() = default; namespace {
diff --git a/cc/raster/raster_buffer_provider_perftest.cc b/cc/raster/raster_buffer_provider_perftest.cc index ab9a739..9b9a2aa 100644 --- a/cc/raster/raster_buffer_provider_perftest.cc +++ b/cc/raster/raster_buffer_provider_perftest.cc
@@ -121,7 +121,7 @@ void RemoveObserver(viz::ContextLostObserver* obs) override {} private: - ~PerfContextProvider() override {} + ~PerfContextProvider() override = default; std::unique_ptr<PerfGLES2Interface> context_gl_; sk_sp<class GrContext> gr_context_; @@ -162,12 +162,12 @@ } protected: - ~PerfTileTask() override {} + ~PerfTileTask() override = default; }; class PerfImageDecodeTaskImpl : public PerfTileTask { public: - PerfImageDecodeTaskImpl() {} + PerfImageDecodeTaskImpl() = default; // Overridden from Task: void RunOnWorkerThread() override {} @@ -176,7 +176,7 @@ void OnTaskCompleted() override {} protected: - ~PerfImageDecodeTaskImpl() override {} + ~PerfImageDecodeTaskImpl() override = default; private: DISALLOW_COPY_AND_ASSIGN(PerfImageDecodeTaskImpl); @@ -206,7 +206,7 @@ void OnTaskCompleted() override { raster_buffer_ = nullptr; } protected: - ~PerfRasterTaskImpl() override {} + ~PerfRasterTaskImpl() override = default; private: std::unique_ptr<ScopedResource> resource_;
diff --git a/cc/raster/raster_buffer_provider_unittest.cc b/cc/raster/raster_buffer_provider_unittest.cc index e5b95956..7cde8ce 100644 --- a/cc/raster/raster_buffer_provider_unittest.cc +++ b/cc/raster/raster_buffer_provider_unittest.cc
@@ -92,7 +92,7 @@ } protected: - ~TestRasterTaskImpl() override {} + ~TestRasterTaskImpl() override = default; private: TestRasterTaskCompletionHandler* completion_handler_; @@ -124,7 +124,7 @@ } protected: - ~BlockingTestRasterTaskImpl() override {} + ~BlockingTestRasterTaskImpl() override = default; private: base::Lock* lock_;
diff --git a/cc/raster/scoped_gpu_raster_unittest.cc b/cc/raster/scoped_gpu_raster_unittest.cc index 7fb2dab..d0dc2d0 100644 --- a/cc/raster/scoped_gpu_raster_unittest.cc +++ b/cc/raster/scoped_gpu_raster_unittest.cc
@@ -11,7 +11,7 @@ class ScopedGpuRasterTest : public testing::Test { public: - ScopedGpuRasterTest() {} + ScopedGpuRasterTest() = default; }; // Releasing ScopedGpuRaster should restore GL_UNPACK_ALIGNMENT == 4.
diff --git a/cc/raster/single_thread_task_graph_runner.cc b/cc/raster/single_thread_task_graph_runner.cc index 1bc18422..e17ec83 100644 --- a/cc/raster/single_thread_task_graph_runner.cc +++ b/cc/raster/single_thread_task_graph_runner.cc
@@ -20,7 +20,7 @@ has_namespaces_with_finished_running_tasks_cv_(&lock_), shutdown_(false) {} -SingleThreadTaskGraphRunner::~SingleThreadTaskGraphRunner() {} +SingleThreadTaskGraphRunner::~SingleThreadTaskGraphRunner() = default; void SingleThreadTaskGraphRunner::Start( const std::string& thread_name,
diff --git a/cc/raster/single_thread_task_graph_runner_unittest.cc b/cc/raster/single_thread_task_graph_runner_unittest.cc index c1533da..e84fb199 100644 --- a/cc/raster/single_thread_task_graph_runner_unittest.cc +++ b/cc/raster/single_thread_task_graph_runner_unittest.cc
@@ -11,7 +11,7 @@ class SingleThreadTaskGraphRunnerTestDelegate { public: - SingleThreadTaskGraphRunnerTestDelegate() {} + SingleThreadTaskGraphRunnerTestDelegate() = default; void StartTaskGraphRunner() { single_thread_task_graph_runner_.Start(
diff --git a/cc/raster/synchronous_task_graph_runner.cc b/cc/raster/synchronous_task_graph_runner.cc index daadbce..4ee102e 100644 --- a/cc/raster/synchronous_task_graph_runner.cc +++ b/cc/raster/synchronous_task_graph_runner.cc
@@ -15,7 +15,7 @@ namespace cc { -SynchronousTaskGraphRunner::SynchronousTaskGraphRunner() {} +SynchronousTaskGraphRunner::SynchronousTaskGraphRunner() = default; SynchronousTaskGraphRunner::~SynchronousTaskGraphRunner() { DCHECK(!work_queue_.HasReadyToRunTasks());
diff --git a/cc/raster/synchronous_task_graph_runner_unittest.cc b/cc/raster/synchronous_task_graph_runner_unittest.cc index 61cebad..1d11e28 100644 --- a/cc/raster/synchronous_task_graph_runner_unittest.cc +++ b/cc/raster/synchronous_task_graph_runner_unittest.cc
@@ -11,7 +11,7 @@ class SynchronousTaskGraphRunnerTestDelegate { public: - SynchronousTaskGraphRunnerTestDelegate() {} + SynchronousTaskGraphRunnerTestDelegate() = default; void StartTaskGraphRunner() {}
diff --git a/cc/raster/task.cc b/cc/raster/task.cc index 94486fd5..415b8dbc 100644 --- a/cc/raster/task.cc +++ b/cc/raster/task.cc
@@ -84,15 +84,15 @@ value_ = Value::CANCELED; } -Task::Task() {} +Task::Task() = default; -Task::~Task() {} +Task::~Task() = default; -TaskGraph::TaskGraph() {} +TaskGraph::TaskGraph() = default; TaskGraph::TaskGraph(TaskGraph&& other) = default; -TaskGraph::~TaskGraph() {} +TaskGraph::~TaskGraph() = default; TaskGraph::Node::Node(scoped_refptr<Task> task, uint16_t category,
diff --git a/cc/raster/task_graph_runner_perftest.cc b/cc/raster/task_graph_runner_perftest.cc index 456abad5..8a67451 100644 --- a/cc/raster/task_graph_runner_perftest.cc +++ b/cc/raster/task_graph_runner_perftest.cc
@@ -28,7 +28,7 @@ public: typedef std::vector<scoped_refptr<PerfTaskImpl>> Vector; - PerfTaskImpl() {} + PerfTaskImpl() = default; // Overridden from Task: void RunOnWorkerThread() override {} @@ -36,7 +36,7 @@ void Reset() { state().Reset(); } private: - ~PerfTaskImpl() override {} + ~PerfTaskImpl() override = default; DISALLOW_COPY_AND_ASSIGN(PerfTaskImpl); };
diff --git a/cc/raster/task_graph_work_queue.cc b/cc/raster/task_graph_work_queue.cc index e2386b34..35ff807 100644 --- a/cc/raster/task_graph_work_queue.cc +++ b/cc/raster/task_graph_work_queue.cc
@@ -101,15 +101,15 @@ } // namespace -TaskGraphWorkQueue::TaskNamespace::TaskNamespace() {} +TaskGraphWorkQueue::TaskNamespace::TaskNamespace() = default; TaskGraphWorkQueue::TaskNamespace::TaskNamespace(TaskNamespace&& other) = default; -TaskGraphWorkQueue::TaskNamespace::~TaskNamespace() {} +TaskGraphWorkQueue::TaskNamespace::~TaskNamespace() = default; TaskGraphWorkQueue::TaskGraphWorkQueue() : next_namespace_id_(1) {} -TaskGraphWorkQueue::~TaskGraphWorkQueue() {} +TaskGraphWorkQueue::~TaskGraphWorkQueue() = default; TaskGraphWorkQueue::PrioritizedTask::PrioritizedTask( scoped_refptr<Task> task,
diff --git a/cc/raster/task_graph_work_queue_unittest.cc b/cc/raster/task_graph_work_queue_unittest.cc index 1968f3d..123364f 100644 --- a/cc/raster/task_graph_work_queue_unittest.cc +++ b/cc/raster/task_graph_work_queue_unittest.cc
@@ -11,13 +11,13 @@ class FakeTaskImpl : public Task { public: - FakeTaskImpl() {} + FakeTaskImpl() = default; // Overridden from Task: void RunOnWorkerThread() override {} private: - ~FakeTaskImpl() override {} + ~FakeTaskImpl() override = default; DISALLOW_COPY_AND_ASSIGN(FakeTaskImpl); };
diff --git a/cc/raster/zero_copy_raster_buffer_provider.cc b/cc/raster/zero_copy_raster_buffer_provider.cc index 194ce14..c4a58851 100644 --- a/cc/raster/zero_copy_raster_buffer_provider.cc +++ b/cc/raster/zero_copy_raster_buffer_provider.cc
@@ -80,7 +80,7 @@ : resource_provider_(resource_provider), preferred_tile_format_(preferred_tile_format) {} -ZeroCopyRasterBufferProvider::~ZeroCopyRasterBufferProvider() {} +ZeroCopyRasterBufferProvider::~ZeroCopyRasterBufferProvider() = default; std::unique_ptr<RasterBuffer> ZeroCopyRasterBufferProvider::AcquireBufferForRaster(
diff --git a/cc/resources/display_resource_provider.cc b/cc/resources/display_resource_provider.cc index a8ac0338..c989fb6 100644 --- a/cc/resources/display_resource_provider.cc +++ b/cc/resources/display_resource_provider.cc
@@ -112,7 +112,7 @@ DisplayResourceProvider::Child::Child(const Child& other) = default; -DisplayResourceProvider::Child::~Child() {} +DisplayResourceProvider::Child::~Child() = default; int DisplayResourceProvider::CreateChild( const ReturnCallback& return_callback) { @@ -486,7 +486,7 @@ unit_(unit), target_(resource_provider->BindForSampling(resource_id, unit_, filter)) {} -DisplayResourceProvider::ScopedSamplerGL::~ScopedSamplerGL() {} +DisplayResourceProvider::ScopedSamplerGL::~ScopedSamplerGL() = default; DisplayResourceProvider::ScopedReadLockSkImage::ScopedReadLockSkImage( DisplayResourceProvider* resource_provider,
diff --git a/cc/resources/memory_history.cc b/cc/resources/memory_history.cc index caf8498..019465d7 100644 --- a/cc/resources/memory_history.cc +++ b/cc/resources/memory_history.cc
@@ -15,7 +15,7 @@ return base::WrapUnique(new MemoryHistory()); } -MemoryHistory::MemoryHistory() {} +MemoryHistory::MemoryHistory() = default; void MemoryHistory::SaveEntry(const MemoryHistory::Entry& entry) { ring_buffer_.SaveToBuffer(entry);
diff --git a/cc/resources/resource_provider.cc b/cc/resources/resource_provider.cc index 9623b794..98434f8 100644 --- a/cc/resources/resource_provider.cc +++ b/cc/resources/resource_provider.cc
@@ -818,7 +818,7 @@ gpu::gles2::GLES2Interface* gl) : gl_(gl), has_synchronized_(true) {} -ResourceProvider::SynchronousFence::~SynchronousFence() {} +ResourceProvider::SynchronousFence::~SynchronousFence() = default; void ResourceProvider::SynchronousFence::Set() { has_synchronized_ = false;
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc index 770b6c61..e60a3e1 100644 --- a/cc/resources/resource_provider_unittest.cc +++ b/cc/resources/resource_provider_unittest.cc
@@ -1195,7 +1195,7 @@ class TestFence : public viz::ResourceFence { public: - TestFence() {} + TestFence() = default; // viz::ResourceFence implementation. void Set() override {} @@ -1205,7 +1205,7 @@ bool passed = false; private: - ~TestFence() override {} + ~TestFence() override = default; }; TEST_P(ResourceProviderTest, ReadLockFenceStopsReturnToChildOrDelete) {
diff --git a/cc/resources/ui_resource_bitmap.cc b/cc/resources/ui_resource_bitmap.cc index 356ad8b29..926c7991 100644 --- a/cc/resources/ui_resource_bitmap.cc +++ b/cc/resources/ui_resource_bitmap.cc
@@ -83,5 +83,5 @@ UIResourceBitmap::UIResourceBitmap(const UIResourceBitmap& other) = default; -UIResourceBitmap::~UIResourceBitmap() {} +UIResourceBitmap::~UIResourceBitmap() = default; } // namespace cc
diff --git a/cc/resources/ui_resource_request.cc b/cc/resources/ui_resource_request.cc index 009ccf3..b9383cc 100644 --- a/cc/resources/ui_resource_request.cc +++ b/cc/resources/ui_resource_request.cc
@@ -36,6 +36,6 @@ return *this; } -UIResourceRequest::~UIResourceRequest() {} +UIResourceRequest::~UIResourceRequest() = default; } // namespace cc
diff --git a/cc/scheduler/begin_frame_tracker.cc b/cc/scheduler/begin_frame_tracker.cc index c220552d..19d106e 100644 --- a/cc/scheduler/begin_frame_tracker.cc +++ b/cc/scheduler/begin_frame_tracker.cc
@@ -12,8 +12,7 @@ current_finished_at_(base::TimeTicks() + base::TimeDelta::FromMicroseconds(-1)) {} -BeginFrameTracker::~BeginFrameTracker() { -} +BeginFrameTracker::~BeginFrameTracker() = default; void BeginFrameTracker::Start(viz::BeginFrameArgs new_args) { // Trace the frame time being passed between BeginFrameTrackers.
diff --git a/cc/scheduler/compositor_timing_history.cc b/cc/scheduler/compositor_timing_history.cc index 0343baa..d6589f573 100644 --- a/cc/scheduler/compositor_timing_history.cc +++ b/cc/scheduler/compositor_timing_history.cc
@@ -16,7 +16,7 @@ class CompositorTimingHistory::UMAReporter { public: - virtual ~UMAReporter() {} + virtual ~UMAReporter() = default; // Throughput measurements virtual void AddBeginMainFrameIntervalCritical(base::TimeDelta interval) = 0; @@ -163,7 +163,7 @@ class RendererUMAReporter : public CompositorTimingHistory::UMAReporter { public: - ~RendererUMAReporter() override {} + ~RendererUMAReporter() override = default; void AddBeginMainFrameIntervalCritical(base::TimeDelta interval) override { UMA_HISTOGRAM_CUSTOM_TIMES_VSYNC_ALIGNED( @@ -288,7 +288,7 @@ class BrowserUMAReporter : public CompositorTimingHistory::UMAReporter { public: - ~BrowserUMAReporter() override {} + ~BrowserUMAReporter() override = default; void AddBeginMainFrameIntervalCritical(base::TimeDelta interval) override { UMA_HISTOGRAM_CUSTOM_TIMES_VSYNC_ALIGNED( @@ -417,7 +417,7 @@ class NullUMAReporter : public CompositorTimingHistory::UMAReporter { public: - ~NullUMAReporter() override {} + ~NullUMAReporter() override = default; void AddBeginMainFrameIntervalCritical(base::TimeDelta interval) override {} void AddBeginMainFrameIntervalNotCritical(base::TimeDelta interval) override { } @@ -479,8 +479,7 @@ uma_reporter_(CreateUMAReporter(uma_category)), rendering_stats_instrumentation_(rendering_stats_instrumentation) {} -CompositorTimingHistory::~CompositorTimingHistory() { -} +CompositorTimingHistory::~CompositorTimingHistory() = default; std::unique_ptr<CompositorTimingHistory::UMAReporter> CompositorTimingHistory::CreateUMAReporter(UMACategory category) {
diff --git a/cc/scheduler/scheduler_settings.cc b/cc/scheduler/scheduler_settings.cc index 2379ac6..de38d19a 100644 --- a/cc/scheduler/scheduler_settings.cc +++ b/cc/scheduler/scheduler_settings.cc
@@ -12,7 +12,7 @@ SchedulerSettings::SchedulerSettings(const SchedulerSettings& other) = default; -SchedulerSettings::~SchedulerSettings() {} +SchedulerSettings::~SchedulerSettings() = default; std::unique_ptr<base::trace_event::ConvertableToTraceFormat> SchedulerSettings::AsValue() const {
diff --git a/cc/scheduler/scheduler_unittest.cc b/cc/scheduler/scheduler_unittest.cc index 6e4d1c03..a30bc284 100644 --- a/cc/scheduler/scheduler_unittest.cc +++ b/cc/scheduler/scheduler_unittest.cc
@@ -261,7 +261,7 @@ task_runner_->SetRunTaskLimit(100); } - ~SchedulerTest() override {} + ~SchedulerTest() override = default; protected: TestScheduler* CreateScheduler(BeginFrameSourceType bfs_type) {
diff --git a/cc/test/animation_test_common.cc b/cc/test/animation_test_common.cc index 40e39b7..fbb07e7 100644 --- a/cc/test/animation_test_common.cc +++ b/cc/test/animation_test_common.cc
@@ -136,7 +136,7 @@ : duration_(base::TimeDelta::FromSecondsD(duration)) { } -FakeFloatAnimationCurve::~FakeFloatAnimationCurve() {} +FakeFloatAnimationCurve::~FakeFloatAnimationCurve() = default; base::TimeDelta FakeFloatAnimationCurve::Duration() const { return duration_; @@ -154,7 +154,7 @@ : duration_(base::TimeDelta::FromSecondsD(duration)) { } -FakeTransformTransition::~FakeTransformTransition() {} +FakeTransformTransition::~FakeTransformTransition() = default; base::TimeDelta FakeTransformTransition::Duration() const { return duration_; @@ -196,7 +196,7 @@ : duration_(base::TimeDelta::FromSecondsD(duration)), from_(from), to_(to) { } -FakeFloatTransition::~FakeFloatTransition() {} +FakeFloatTransition::~FakeFloatTransition() = default; base::TimeDelta FakeFloatTransition::Duration() const { return duration_;
diff --git a/cc/test/animation_timelines_test_common.cc b/cc/test/animation_timelines_test_common.cc index c848f34..313ac73 100644 --- a/cc/test/animation_timelines_test_common.cc +++ b/cc/test/animation_timelines_test_common.cc
@@ -26,7 +26,7 @@ ClearMutatedProperties(); } -TestLayer::~TestLayer() {} +TestLayer::~TestLayer() = default; void TestLayer::ClearMutatedProperties() { transform_ = gfx::Transform(); @@ -360,8 +360,7 @@ element_id_ = ElementId(NextTestLayerId()); } -AnimationTimelinesTest::~AnimationTimelinesTest() { -} +AnimationTimelinesTest::~AnimationTimelinesTest() = default; void AnimationTimelinesTest::SetUp() { timeline_ = AnimationTimeline::Create(timeline_id_);
diff --git a/cc/test/cc_test_suite.cc b/cc/test/cc_test_suite.cc index bda6256..648c16e 100644 --- a/cc/test/cc_test_suite.cc +++ b/cc/test/cc_test_suite.cc
@@ -14,7 +14,7 @@ CCTestSuite::CCTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} -CCTestSuite::~CCTestSuite() {} +CCTestSuite::~CCTestSuite() = default; void CCTestSuite::Initialize() { base::TestSuite::Initialize();
diff --git a/cc/test/fake_content_layer_client.cc b/cc/test/fake_content_layer_client.cc index 773bcf9..99c21835 100644 --- a/cc/test/fake_content_layer_client.cc +++ b/cc/test/fake_content_layer_client.cc
@@ -24,7 +24,7 @@ FakeContentLayerClient::ImageData::ImageData(const ImageData& other) = default; -FakeContentLayerClient::ImageData::~ImageData() {} +FakeContentLayerClient::ImageData::~ImageData() = default; FakeContentLayerClient::FakeContentLayerClient() : fill_with_nonsolid_color_(false), @@ -34,8 +34,7 @@ bounds_set_(false), contains_slow_paths_(false) {} -FakeContentLayerClient::~FakeContentLayerClient() { -} +FakeContentLayerClient::~FakeContentLayerClient() = default; gfx::Rect FakeContentLayerClient::PaintableRegion() { CHECK(bounds_set_);
diff --git a/cc/test/fake_painted_scrollbar_layer.cc b/cc/test/fake_painted_scrollbar_layer.cc index a12d8946..7a852fa0 100644 --- a/cc/test/fake_painted_scrollbar_layer.cc +++ b/cc/test/fake_painted_scrollbar_layer.cc
@@ -44,7 +44,7 @@ SetIsDrawable(true); } -FakePaintedScrollbarLayer::~FakePaintedScrollbarLayer() {} +FakePaintedScrollbarLayer::~FakePaintedScrollbarLayer() = default; bool FakePaintedScrollbarLayer::Update() { bool updated = PaintedScrollbarLayer::Update();
diff --git a/cc/test/fake_picture_layer.cc b/cc/test/fake_picture_layer.cc index ef473ec2..e1f7440 100644 --- a/cc/test/fake_picture_layer.cc +++ b/cc/test/fake_picture_layer.cc
@@ -21,7 +21,7 @@ SetIsDrawable(true); } -FakePictureLayer::~FakePictureLayer() {} +FakePictureLayer::~FakePictureLayer() = default; std::unique_ptr<LayerImpl> FakePictureLayer::CreateLayerImpl( LayerTreeImpl* tree_impl) {
diff --git a/cc/test/fake_picture_layer_tiling_client.cc b/cc/test/fake_picture_layer_tiling_client.cc index a330417f..33c236a 100644 --- a/cc/test/fake_picture_layer_tiling_client.cc +++ b/cc/test/fake_picture_layer_tiling_client.cc
@@ -36,8 +36,7 @@ twin_tiling_(nullptr), has_valid_tile_priorities_(true) {} -FakePictureLayerTilingClient::~FakePictureLayerTilingClient() { -} +FakePictureLayerTilingClient::~FakePictureLayerTilingClient() = default; std::unique_ptr<Tile> FakePictureLayerTilingClient::CreateTile( const Tile::CreateInfo& info) {
diff --git a/cc/test/fake_raster_buffer_provider.cc b/cc/test/fake_raster_buffer_provider.cc index dbae6497..539f63c 100644 --- a/cc/test/fake_raster_buffer_provider.cc +++ b/cc/test/fake_raster_buffer_provider.cc
@@ -6,9 +6,9 @@ namespace cc { -FakeRasterBufferProviderImpl::FakeRasterBufferProviderImpl() {} +FakeRasterBufferProviderImpl::FakeRasterBufferProviderImpl() = default; -FakeRasterBufferProviderImpl::~FakeRasterBufferProviderImpl() {} +FakeRasterBufferProviderImpl::~FakeRasterBufferProviderImpl() = default; std::unique_ptr<RasterBuffer> FakeRasterBufferProviderImpl::AcquireBufferForRaster(
diff --git a/cc/test/fake_raster_source.cc b/cc/test/fake_raster_source.cc index 973a305..177a7f1 100644 --- a/cc/test/fake_raster_source.cc +++ b/cc/test/fake_raster_source.cc
@@ -144,7 +144,7 @@ : RasterSource(recording_source), playback_allowed_event_(playback_allowed_event) {} -FakeRasterSource::~FakeRasterSource() {} +FakeRasterSource::~FakeRasterSource() = default; void FakeRasterSource::PlaybackToCanvas( SkCanvas* canvas,
diff --git a/cc/test/fake_scrollbar.cc b/cc/test/fake_scrollbar.cc index 57a6ceef..5002fd5 100644 --- a/cc/test/fake_scrollbar.cc +++ b/cc/test/fake_scrollbar.cc
@@ -33,7 +33,7 @@ track_rect_(0, 0, 100, 10), fill_color_(SK_ColorGREEN) {} -FakeScrollbar::~FakeScrollbar() {} +FakeScrollbar::~FakeScrollbar() = default; ScrollbarOrientation FakeScrollbar::Orientation() const { return orientation_;
diff --git a/cc/test/fake_tile_manager.cc b/cc/test/fake_tile_manager.cc index 5a40ac3..716c8ec9 100644 --- a/cc/test/fake_tile_manager.cc +++ b/cc/test/fake_tile_manager.cc
@@ -51,7 +51,7 @@ SetTileTaskManagerForTesting(std::make_unique<FakeTileTaskManagerImpl>()); } -FakeTileManager::~FakeTileManager() {} +FakeTileManager::~FakeTileManager() = default; bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { return std::find(tiles_for_raster.begin(),
diff --git a/cc/test/fake_tile_manager_client.cc b/cc/test/fake_tile_manager_client.cc index 28bd304..b026981 100644 --- a/cc/test/fake_tile_manager_client.cc +++ b/cc/test/fake_tile_manager_client.cc
@@ -8,11 +8,9 @@ namespace cc { -FakeTileManagerClient::FakeTileManagerClient() { -} +FakeTileManagerClient::FakeTileManagerClient() = default; -FakeTileManagerClient::~FakeTileManagerClient() { -} +FakeTileManagerClient::~FakeTileManagerClient() = default; std::unique_ptr<RasterTilePriorityQueue> FakeTileManagerClient::BuildRasterQueue(TreePriority tree_priority,
diff --git a/cc/test/fake_tile_task_manager.cc b/cc/test/fake_tile_task_manager.cc index 439110e..fe8c79d 100644 --- a/cc/test/fake_tile_task_manager.cc +++ b/cc/test/fake_tile_task_manager.cc
@@ -8,7 +8,7 @@ namespace cc { -FakeTileTaskManagerImpl::FakeTileTaskManagerImpl() {} +FakeTileTaskManagerImpl::FakeTileTaskManagerImpl() = default; FakeTileTaskManagerImpl::~FakeTileTaskManagerImpl() { DCHECK_EQ(0u, completed_tasks_.size());
diff --git a/cc/test/fake_ui_resource_layer_tree_host_impl.cc b/cc/test/fake_ui_resource_layer_tree_host_impl.cc index a19205d..c24049be 100644 --- a/cc/test/fake_ui_resource_layer_tree_host_impl.cc +++ b/cc/test/fake_ui_resource_layer_tree_host_impl.cc
@@ -14,7 +14,7 @@ TaskGraphRunner* task_graph_runner) : FakeLayerTreeHostImpl(task_runner_provider, task_graph_runner) {} -FakeUIResourceLayerTreeHostImpl::~FakeUIResourceLayerTreeHostImpl() {} +FakeUIResourceLayerTreeHostImpl::~FakeUIResourceLayerTreeHostImpl() = default; void FakeUIResourceLayerTreeHostImpl::CreateUIResource( UIResourceId uid,
diff --git a/cc/test/layer_tree_pixel_test.cc b/cc/test/layer_tree_pixel_test.cc index c80c603..68c48f3 100644 --- a/cc/test/layer_tree_pixel_test.cc +++ b/cc/test/layer_tree_pixel_test.cc
@@ -35,7 +35,7 @@ test_type_(PIXEL_TEST_GL), pending_texture_mailbox_callbacks_(0) {} -LayerTreePixelTest::~LayerTreePixelTest() {} +LayerTreePixelTest::~LayerTreePixelTest() = default; std::unique_ptr<viz::TestLayerTreeFrameSink> LayerTreePixelTest::CreateLayerTreeFrameSink(
diff --git a/cc/test/layer_tree_test.cc b/cc/test/layer_tree_test.cc index 8dd61405..a047004 100644 --- a/cc/test/layer_tree_test.cc +++ b/cc/test/layer_tree_test.cc
@@ -401,7 +401,7 @@ TestHooks* test_hooks) { return base::WrapUnique(new LayerTreeHostClientForTesting(test_hooks)); } - ~LayerTreeHostClientForTesting() override {} + ~LayerTreeHostClientForTesting() override = default; void WillBeginMainFrame() override { test_hooks_->WillBeginMainFrame(); }
diff --git a/cc/test/mock_layer_tree_mutator.cc b/cc/test/mock_layer_tree_mutator.cc index 145252a..536bc9d 100644 --- a/cc/test/mock_layer_tree_mutator.cc +++ b/cc/test/mock_layer_tree_mutator.cc
@@ -6,8 +6,8 @@ namespace cc { -MockLayerTreeMutator::MockLayerTreeMutator() {} +MockLayerTreeMutator::MockLayerTreeMutator() = default; -MockLayerTreeMutator::~MockLayerTreeMutator() {} +MockLayerTreeMutator::~MockLayerTreeMutator() = default; } // namespace cc
diff --git a/cc/test/ordered_texture_map.cc b/cc/test/ordered_texture_map.cc index 352319f..0a55b9c 100644 --- a/cc/test/ordered_texture_map.cc +++ b/cc/test/ordered_texture_map.cc
@@ -13,9 +13,9 @@ namespace cc { -OrderedTextureMap::OrderedTextureMap() {} +OrderedTextureMap::OrderedTextureMap() = default; -OrderedTextureMap::~OrderedTextureMap() {} +OrderedTextureMap::~OrderedTextureMap() = default; void OrderedTextureMap::Append(GLuint id, scoped_refptr<TestTexture> texture) {
diff --git a/cc/test/scheduler_test_common.cc b/cc/test/scheduler_test_common.cc index fb7537c7..8052f46b 100644 --- a/cc/test/scheduler_test_common.cc +++ b/cc/test/scheduler_test_common.cc
@@ -34,8 +34,7 @@ rendering_stats_instrumentation_owned_( std::move(rendering_stats_instrumentation)) {} -FakeCompositorTimingHistory::~FakeCompositorTimingHistory() { -} +FakeCompositorTimingHistory::~FakeCompositorTimingHistory() = default; void FakeCompositorTimingHistory::SetAllEstimatesTo(base::TimeDelta duration) { begin_main_frame_queue_duration_critical_ = duration; @@ -137,7 +136,6 @@ return now_src_->NowTicks(); } -TestScheduler::~TestScheduler() { -} +TestScheduler::~TestScheduler() = default; } // namespace cc
diff --git a/cc/test/test_context_support.cc b/cc/test/test_context_support.cc index 016f0768..83d8a62 100644 --- a/cc/test/test_context_support.cc +++ b/cc/test/test_context_support.cc
@@ -17,7 +17,7 @@ TestContextSupport::TestContextSupport() : out_of_order_callbacks_(false), weak_ptr_factory_(this) {} -TestContextSupport::~TestContextSupport() {} +TestContextSupport::~TestContextSupport() = default; void TestContextSupport::FlushPendingWork() {}
diff --git a/cc/test/test_hooks.cc b/cc/test/test_hooks.cc index 5850154..b254924 100644 --- a/cc/test/test_hooks.cc +++ b/cc/test/test_hooks.cc
@@ -6,9 +6,9 @@ namespace cc { -TestHooks::TestHooks() {} +TestHooks::TestHooks() = default; -TestHooks::~TestHooks() {} +TestHooks::~TestHooks() = default; DrawResult TestHooks::PrepareToDrawOnThread( LayerTreeHostImpl* host_impl,
diff --git a/cc/test/test_image_factory.cc b/cc/test/test_image_factory.cc index 6461140c..7cbfd4f 100644 --- a/cc/test/test_image_factory.cc +++ b/cc/test/test_image_factory.cc
@@ -11,11 +11,9 @@ namespace cc { -TestImageFactory::TestImageFactory() { -} +TestImageFactory::TestImageFactory() = default; -TestImageFactory::~TestImageFactory() { -} +TestImageFactory::~TestImageFactory() = default; scoped_refptr<gl::GLImage> TestImageFactory::CreateImageForGpuMemoryBuffer( const gfx::GpuMemoryBufferHandle& handle,
diff --git a/cc/test/test_in_process_context_provider.cc b/cc/test/test_in_process_context_provider.cc index 7e900fa..2952964 100644 --- a/cc/test/test_in_process_context_provider.cc +++ b/cc/test/test_in_process_context_provider.cc
@@ -80,8 +80,7 @@ } } -TestInProcessContextProvider::~TestInProcessContextProvider() { -} +TestInProcessContextProvider::~TestInProcessContextProvider() = default; gpu::ContextResult TestInProcessContextProvider::BindToCurrentThread() { return gpu::ContextResult::kSuccess;
diff --git a/cc/test/test_shared_bitmap_manager.cc b/cc/test/test_shared_bitmap_manager.cc index 8826023..0e3373292 100644 --- a/cc/test/test_shared_bitmap_manager.cc +++ b/cc/test/test_shared_bitmap_manager.cc
@@ -24,7 +24,7 @@ g_next_sequence_number++), shared_memory_(std::move(shared_memory)) {} - ~OwnedSharedBitmap() override {} + ~OwnedSharedBitmap() override = default; // viz::SharedBitmap: base::SharedMemoryHandle GetSharedMemoryHandle() const override { @@ -48,9 +48,9 @@ } // namespace -TestSharedBitmapManager::TestSharedBitmapManager() {} +TestSharedBitmapManager::TestSharedBitmapManager() = default; -TestSharedBitmapManager::~TestSharedBitmapManager() {} +TestSharedBitmapManager::~TestSharedBitmapManager() = default; std::unique_ptr<viz::SharedBitmap> TestSharedBitmapManager::AllocateSharedBitmap(const gfx::Size& size) {
diff --git a/cc/test/test_texture.cc b/cc/test/test_texture.cc index 662692a..9433253 100644 --- a/cc/test/test_texture.cc +++ b/cc/test/test_texture.cc
@@ -28,7 +28,7 @@ params[GL_TEXTURE_USAGE_ANGLE] = GL_NONE; } -TestTexture::~TestTexture() {} +TestTexture::~TestTexture() = default; void TestTexture::Reallocate(const gfx::Size& size, viz::ResourceFormat format) {
diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc index 84b16fe..deb573e 100644 --- a/cc/test/test_web_graphics_context_3d.cc +++ b/cc/test/test_web_graphics_context_3d.cc
@@ -792,7 +792,7 @@ bound_textures_[GL_TEXTURE_RECTANGLE_ARB] = 0; } -TestWebGraphicsContext3D::TextureTargets::~TextureTargets() {} +TestWebGraphicsContext3D::TextureTargets::~TextureTargets() = default; void TestWebGraphicsContext3D::TextureTargets::BindTexture( GLenum target, @@ -843,10 +843,10 @@ TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {} -TestWebGraphicsContext3D::Buffer::~Buffer() {} +TestWebGraphicsContext3D::Buffer::~Buffer() = default; -TestWebGraphicsContext3D::Image::Image() {} +TestWebGraphicsContext3D::Image::Image() = default; -TestWebGraphicsContext3D::Image::~Image() {} +TestWebGraphicsContext3D::Image::~Image() = default; } // namespace cc
diff --git a/cc/tiles/eviction_tile_priority_queue.cc b/cc/tiles/eviction_tile_priority_queue.cc index acf2da9..4bb198a 100644 --- a/cc/tiles/eviction_tile_priority_queue.cc +++ b/cc/tiles/eviction_tile_priority_queue.cc
@@ -92,11 +92,9 @@ } // namespace -EvictionTilePriorityQueue::EvictionTilePriorityQueue() { -} +EvictionTilePriorityQueue::EvictionTilePriorityQueue() = default; -EvictionTilePriorityQueue::~EvictionTilePriorityQueue() { -} +EvictionTilePriorityQueue::~EvictionTilePriorityQueue() = default; void EvictionTilePriorityQueue::Build( const std::vector<PictureLayerImpl*>& active_layers,
diff --git a/cc/tiles/gpu_image_decode_cache.cc b/cc/tiles/gpu_image_decode_cache.cc index 0534b9e61..d85d273 100644 --- a/cc/tiles/gpu_image_decode_cache.cc +++ b/cc/tiles/gpu_image_decode_cache.cc
@@ -291,7 +291,7 @@ } protected: - ~GpuImageDecodeTaskImpl() override {} + ~GpuImageDecodeTaskImpl() override = default; private: GpuImageDecodeCache* cache_; @@ -335,7 +335,7 @@ } protected: - ~ImageUploadTaskImpl() override {} + ~ImageUploadTaskImpl() override = default; private: GpuImageDecodeCache* cache_;
diff --git a/cc/tiles/gpu_image_decode_cache_unittest.cc b/cc/tiles/gpu_image_decode_cache_unittest.cc index 6c72e94f..aa3ba6aa 100644 --- a/cc/tiles/gpu_image_decode_cache_unittest.cc +++ b/cc/tiles/gpu_image_decode_cache_unittest.cc
@@ -178,7 +178,7 @@ } private: - ~DiscardableTextureMockContextProvider() override {} + ~DiscardableTextureMockContextProvider() override = default; DiscardableTextureMockContextProvider( std::unique_ptr<TestContextSupport> support, std::unique_ptr<TestGLES2Interface> gl,
diff --git a/cc/tiles/image_controller_unittest.cc b/cc/tiles/image_controller_unittest.cc index fc085df4..b16f6e3 100644 --- a/cc/tiles/image_controller_unittest.cc +++ b/cc/tiles/image_controller_unittest.cc
@@ -135,7 +135,7 @@ // A simple class that can receive decode callbacks. class DecodeClient { public: - DecodeClient() {} + DecodeClient() = default; void Callback(base::OnceClosure quit_closure, ImageController::ImageDecodeRequestId id, ImageController::ImageDecodeResult result) {
diff --git a/cc/tiles/picture_layer_tiling.cc b/cc/tiles/picture_layer_tiling.cc index 4b616b8..1a5df00b 100644 --- a/cc/tiles/picture_layer_tiling.cc +++ b/cc/tiles/picture_layer_tiling.cc
@@ -65,8 +65,7 @@ tiling_data_.SetMaxTextureSize(tile_size); } -PictureLayerTiling::~PictureLayerTiling() { -} +PictureLayerTiling::~PictureLayerTiling() = default; Tile* PictureLayerTiling::CreateTile(const Tile::CreateInfo& info) { const int i = info.tiling_i_index; @@ -428,8 +427,7 @@ ++(*this); } -PictureLayerTiling::CoverageIterator::~CoverageIterator() { -} +PictureLayerTiling::CoverageIterator::~CoverageIterator() = default; PictureLayerTiling::CoverageIterator& PictureLayerTiling::CoverageIterator::operator++() {
diff --git a/cc/tiles/picture_layer_tiling_unittest.cc b/cc/tiles/picture_layer_tiling_unittest.cc index e1bca1ee..87424be81 100644 --- a/cc/tiles/picture_layer_tiling_unittest.cc +++ b/cc/tiles/picture_layer_tiling_unittest.cc
@@ -88,8 +88,8 @@ class PictureLayerTilingIteratorTest : public testing::Test { public: - PictureLayerTilingIteratorTest() {} - ~PictureLayerTilingIteratorTest() override {} + PictureLayerTilingIteratorTest() = default; + ~PictureLayerTilingIteratorTest() override = default; void Initialize(const gfx::Size& tile_size, float contents_scale,
diff --git a/cc/tiles/raster_tile_priority_queue_all.cc b/cc/tiles/raster_tile_priority_queue_all.cc index 0b9a1af..96b98c5 100644 --- a/cc/tiles/raster_tile_priority_queue_all.cc +++ b/cc/tiles/raster_tile_priority_queue_all.cc
@@ -83,11 +83,9 @@ } // namespace -RasterTilePriorityQueueAll::RasterTilePriorityQueueAll() { -} +RasterTilePriorityQueueAll::RasterTilePriorityQueueAll() = default; -RasterTilePriorityQueueAll::~RasterTilePriorityQueueAll() { -} +RasterTilePriorityQueueAll::~RasterTilePriorityQueueAll() = default; void RasterTilePriorityQueueAll::Build( const std::vector<PictureLayerImpl*>& active_layers,
diff --git a/cc/tiles/raster_tile_priority_queue_required.cc b/cc/tiles/raster_tile_priority_queue_required.cc index 62cb9a24..b1dea8a 100644 --- a/cc/tiles/raster_tile_priority_queue_required.cc +++ b/cc/tiles/raster_tile_priority_queue_required.cc
@@ -28,11 +28,9 @@ } // namespace -RasterTilePriorityQueueRequired::RasterTilePriorityQueueRequired() { -} +RasterTilePriorityQueueRequired::RasterTilePriorityQueueRequired() = default; -RasterTilePriorityQueueRequired::~RasterTilePriorityQueueRequired() { -} +RasterTilePriorityQueueRequired::~RasterTilePriorityQueueRequired() = default; void RasterTilePriorityQueueRequired::Build( const std::vector<PictureLayerImpl*>& active_layers,
diff --git a/cc/tiles/software_image_decode_cache.cc b/cc/tiles/software_image_decode_cache.cc index ed2be4e..732c2bc 100644 --- a/cc/tiles/software_image_decode_cache.cc +++ b/cc/tiles/software_image_decode_cache.cc
@@ -124,7 +124,7 @@ } protected: - ~SoftwareImageDecodeTaskImpl() override {} + ~SoftwareImageDecodeTaskImpl() override = default; private: SoftwareImageDecodeCache* cache_;
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc index b4e7a6c..f3f52fa 100644 --- a/cc/tiles/tile_manager.cc +++ b/cc/tiles/tile_manager.cc
@@ -322,7 +322,7 @@ void OnTaskCompleted() override {} protected: - ~TaskSetFinishedTaskImpl() override {} + ~TaskSetFinishedTaskImpl() override = default; void TaskSetFinished() { task_runner_->PostTask(FROM_HERE, on_task_set_finished_callback_);
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index 47ff044..d6d4536 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc
@@ -1886,7 +1886,7 @@ explicit VerifyResourceContentIdRasterBufferProvider( uint64_t expected_resource_id) : expected_resource_id_(expected_resource_id) {} - ~VerifyResourceContentIdRasterBufferProvider() override {} + ~VerifyResourceContentIdRasterBufferProvider() override = default; // RasterBufferProvider methods. std::unique_ptr<RasterBuffer> AcquireBufferForRaster(
diff --git a/cc/tiles/tile_task_manager.cc b/cc/tiles/tile_task_manager.cc index 06ba66c..2bfdd9e 100644 --- a/cc/tiles/tile_task_manager.cc +++ b/cc/tiles/tile_task_manager.cc
@@ -9,9 +9,9 @@ namespace cc { -TileTaskManager::TileTaskManager() {} +TileTaskManager::TileTaskManager() = default; -TileTaskManager::~TileTaskManager() {} +TileTaskManager::~TileTaskManager() = default; // static std::unique_ptr<TileTaskManagerImpl> TileTaskManagerImpl::Create( @@ -24,7 +24,7 @@ : task_graph_runner_(task_graph_runner), namespace_token_(task_graph_runner->GenerateNamespaceToken()) {} -TileTaskManagerImpl::~TileTaskManagerImpl() {} +TileTaskManagerImpl::~TileTaskManagerImpl() = default; void TileTaskManagerImpl::ScheduleTasks(TaskGraph* graph) { TRACE_EVENT0("cc", "TileTaskManagerImpl::ScheduleTasks");
diff --git a/cc/tiles/tiling_set_eviction_queue.cc b/cc/tiles/tiling_set_eviction_queue.cc index 5ba7913c..3e1fc1c 100644 --- a/cc/tiles/tiling_set_eviction_queue.cc +++ b/cc/tiles/tiling_set_eviction_queue.cc
@@ -28,8 +28,7 @@ current_tile_ = *eventually_iterator_; } -TilingSetEvictionQueue::~TilingSetEvictionQueue() { -} +TilingSetEvictionQueue::~TilingSetEvictionQueue() = default; void TilingSetEvictionQueue::GenerateTilingOrder( PictureLayerTilingSet* tiling_set) {
diff --git a/cc/tiles/tiling_set_raster_queue_all.cc b/cc/tiles/tiling_set_raster_queue_all.cc index f2c1916..3e2e8c9 100644 --- a/cc/tiles/tiling_set_raster_queue_all.cc +++ b/cc/tiles/tiling_set_raster_queue_all.cc
@@ -104,8 +104,7 @@ AdvanceToNextStage(); } -TilingSetRasterQueueAll::~TilingSetRasterQueueAll() { -} +TilingSetRasterQueueAll::~TilingSetRasterQueueAll() = default; void TilingSetRasterQueueAll::MakeTilingIterator(IteratorType type, PictureLayerTiling* tiling) { @@ -376,8 +375,7 @@ current_tile_ = *visible_iterator_; } -TilingSetRasterQueueAll::TilingIterator::~TilingIterator() { -} +TilingSetRasterQueueAll::TilingIterator::~TilingIterator() = default; void TilingSetRasterQueueAll::TilingIterator::AdvancePhase() { DCHECK_LT(phase_, Phase::EVENTUALLY_RECT);
diff --git a/cc/tiles/tiling_set_raster_queue_required.cc b/cc/tiles/tiling_set_raster_queue_required.cc index 412942c9..8fba912 100644 --- a/cc/tiles/tiling_set_raster_queue_required.cc +++ b/cc/tiles/tiling_set_raster_queue_required.cc
@@ -58,8 +58,7 @@ ++iterator_; } -TilingSetRasterQueueRequired::~TilingSetRasterQueueRequired() { -} +TilingSetRasterQueueRequired::~TilingSetRasterQueueRequired() = default; bool TilingSetRasterQueueRequired::IsEmpty() const { return iterator_.done(); @@ -112,8 +111,7 @@ ++(*this); } -TilingSetRasterQueueRequired::TilingIterator::~TilingIterator() { -} +TilingSetRasterQueueRequired::TilingIterator::~TilingIterator() = default; TilingSetRasterQueueRequired::TilingIterator& TilingSetRasterQueueRequired::TilingIterator::
diff --git a/cc/trees/clip_node.cc b/cc/trees/clip_node.cc index a949dcb9..3c9c58f 100644 --- a/cc/trees/clip_node.cc +++ b/cc/trees/clip_node.cc
@@ -22,7 +22,7 @@ ClipNode& ClipNode::operator=(const ClipNode& other) = default; -ClipNode::~ClipNode() {} +ClipNode::~ClipNode() = default; bool ClipNode::operator==(const ClipNode& other) const { return id == other.id && parent_id == other.parent_id &&
diff --git a/cc/trees/damage_tracker.cc b/cc/trees/damage_tracker.cc index 7c127eb..56f03bf 100644 --- a/cc/trees/damage_tracker.cc +++ b/cc/trees/damage_tracker.cc
@@ -27,7 +27,7 @@ DamageTracker::DamageTracker() : mailboxId_(0) {} -DamageTracker::~DamageTracker() {} +DamageTracker::~DamageTracker() = default; void DamageTracker::UpdateDamageTracking( LayerTreeImpl* layer_tree_impl,
diff --git a/cc/trees/debug_rect_history.cc b/cc/trees/debug_rect_history.cc index aa99eb55..953d1e3b 100644 --- a/cc/trees/debug_rect_history.cc +++ b/cc/trees/debug_rect_history.cc
@@ -24,9 +24,9 @@ return base::WrapUnique(new DebugRectHistory()); } -DebugRectHistory::DebugRectHistory() {} +DebugRectHistory::DebugRectHistory() = default; -DebugRectHistory::~DebugRectHistory() {} +DebugRectHistory::~DebugRectHistory() = default; void DebugRectHistory::SaveDebugRectsForCurrentFrame( LayerTreeImpl* tree_impl,
diff --git a/cc/trees/image_animation_controller_unittest.cc b/cc/trees/image_animation_controller_unittest.cc index 5214058..1a4c486 100644 --- a/cc/trees/image_animation_controller_unittest.cc +++ b/cc/trees/image_animation_controller_unittest.cc
@@ -15,8 +15,8 @@ class FakeAnimationDriver : public ImageAnimationController::AnimationDriver { public: - FakeAnimationDriver() {} - ~FakeAnimationDriver() override {} + FakeAnimationDriver() = default; + ~FakeAnimationDriver() override = default; void set_should_animate(bool should_animate) { should_animate_ = should_animate;
diff --git a/cc/trees/latency_info_swap_promise_monitor.cc b/cc/trees/latency_info_swap_promise_monitor.cc index dc25793..7bca0d6 100644 --- a/cc/trees/latency_info_swap_promise_monitor.cc +++ b/cc/trees/latency_info_swap_promise_monitor.cc
@@ -46,8 +46,7 @@ LayerTreeHostImpl* host_impl) : SwapPromiseMonitor(swap_promise_manager, host_impl), latency_(latency) {} -LatencyInfoSwapPromiseMonitor::~LatencyInfoSwapPromiseMonitor() { -} +LatencyInfoSwapPromiseMonitor::~LatencyInfoSwapPromiseMonitor() = default; void LatencyInfoSwapPromiseMonitor::OnSetNeedsCommitOnMain() { if (AddRenderingScheduledComponent(latency_, true /* on_main */)) {
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index ddc05e86..08268c6 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc
@@ -67,9 +67,9 @@ namespace cc { -LayerTreeHost::InitParams::InitParams() {} +LayerTreeHost::InitParams::InitParams() = default; -LayerTreeHost::InitParams::~InitParams() {} +LayerTreeHost::InitParams::~InitParams() = default; std::unique_ptr<LayerTreeHost> LayerTreeHost::CreateThreaded( scoped_refptr<base::SingleThreadTaskRunner> impl_task_runner, @@ -953,9 +953,9 @@ SetNeedsFullTreeSync(); } -LayerTreeHost::ViewportLayers::ViewportLayers() {} +LayerTreeHost::ViewportLayers::ViewportLayers() = default; -LayerTreeHost::ViewportLayers::~ViewportLayers() {} +LayerTreeHost::ViewportLayers::~ViewportLayers() = default; void LayerTreeHost::RegisterViewportLayers(const ViewportLayers& layers) { DCHECK(!layers.inner_viewport_scroll ||
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc index 867895e..215b52f3 100644 --- a/cc/trees/layer_tree_host_common.cc +++ b/cc/trees/layer_tree_host_common.cc
@@ -176,7 +176,7 @@ has_scrolled_by_wheel(false), has_scrolled_by_touch(false) {} -ScrollAndScaleSet::~ScrollAndScaleSet() {} +ScrollAndScaleSet::~ScrollAndScaleSet() = default; static inline void SetMaskLayersContributeToDrawnRenderSurface( RenderSurfaceImpl* surface,
diff --git a/cc/trees/layer_tree_host_common_unittest.cc b/cc/trees/layer_tree_host_common_unittest.cc index ccedbe95..774fe2d 100644 --- a/cc/trees/layer_tree_host_common_unittest.cc +++ b/cc/trees/layer_tree_host_common_unittest.cc
@@ -57,8 +57,7 @@ class VerifyTreeCalcsLayerTreeSettings : public LayerTreeSettings { public: - VerifyTreeCalcsLayerTreeSettings() { - } + VerifyTreeCalcsLayerTreeSettings() = default; }; class LayerTreeHostCommonTestBase : public LayerTestCommon::LayerImplTest { @@ -300,12 +299,12 @@ class LayerWithForcedDrawsContent : public Layer { public: - LayerWithForcedDrawsContent() {} + LayerWithForcedDrawsContent() = default; bool DrawsContent() const override { return true; } private: - ~LayerWithForcedDrawsContent() override {} + ~LayerWithForcedDrawsContent() override = default; }; class LayerTreeSettingsScaleContent : public VerifyTreeCalcsLayerTreeSettings { @@ -7266,7 +7265,7 @@ new AnimationScaleFactorTrackingLayerImpl(tree_impl, id)); } - ~AnimationScaleFactorTrackingLayerImpl() override {} + ~AnimationScaleFactorTrackingLayerImpl() override = default; private: explicit AnimationScaleFactorTrackingLayerImpl(LayerTreeImpl* tree_impl,
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index f2e123f94..fcf74cc 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -175,7 +175,7 @@ has_no_damage(false), may_contain_video(false) {} -LayerTreeHostImpl::FrameData::~FrameData() {} +LayerTreeHostImpl::FrameData::~FrameData() = default; std::unique_ptr<LayerTreeHostImpl> LayerTreeHostImpl::Create( const LayerTreeSettings& settings,
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index aa669b28..0ec8edd 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -756,7 +756,7 @@ : page_scale_factor_(0.f), min_page_scale_factor_(-1.f), max_page_scale_factor_(-1.f) {} - ~TestInputHandlerClient() override {} + ~TestInputHandlerClient() override = default; // InputHandlerClient implementation. void WillShutdown() override {} @@ -9852,7 +9852,7 @@ set_needs_redraw_count_(set_needs_redraw_count), forward_to_main_count_(forward_to_main_count) {} - ~SimpleSwapPromiseMonitor() override {} + ~SimpleSwapPromiseMonitor() override = default; void OnSetNeedsCommitOnMain() override { (*set_needs_commit_count_)++; }
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc index de2ebdf0..c6575b38 100644 --- a/cc/trees/layer_tree_host_pixeltest_masks.cc +++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -32,7 +32,7 @@ class MaskContentLayerClient : public ContentLayerClient { public: explicit MaskContentLayerClient(const gfx::Size& bounds) : bounds_(bounds) {} - ~MaskContentLayerClient() override {} + ~MaskContentLayerClient() override = default; bool FillsBoundsCompletely() const override { return false; } size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } @@ -181,7 +181,7 @@ SkColor color, bool vertical) : bounds_(bounds), color_(color), vertical_(vertical) {} - ~CheckerContentLayerClient() override {} + ~CheckerContentLayerClient() override = default; bool FillsBoundsCompletely() const override { return false; } size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } gfx::Rect PaintableRegion() override { return gfx::Rect(bounds_); } @@ -230,7 +230,7 @@ public: explicit CircleContentLayerClient(const gfx::Size& bounds) : bounds_(bounds) {} - ~CircleContentLayerClient() override {} + ~CircleContentLayerClient() override = default; bool FillsBoundsCompletely() const override { return false; } size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } gfx::Rect PaintableRegion() override { return gfx::Rect(bounds_); } @@ -393,7 +393,7 @@ protected: explicit StaticPictureLayer(scoped_refptr<DisplayItemList> display_list) : PictureLayer(this), display_list_(std::move(display_list)) {} - ~StaticPictureLayer() override {} + ~StaticPictureLayer() override = default; private: scoped_refptr<DisplayItemList> display_list_;
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc index b97ab4c4..6ac0313 100644 --- a/cc/trees/layer_tree_host_unittest.cc +++ b/cc/trees/layer_tree_host_unittest.cc
@@ -487,7 +487,7 @@ protected: class MockContextSupport : public TestContextSupport { public: - MockContextSupport() {} + MockContextSupport() = default; MOCK_METHOD1(SetAggressivelyFreeResources, void(bool aggressively_free_resources)); }; @@ -2407,7 +2407,7 @@ // its damage is preserved until the next time it is drawn. class LayerTreeHostTestDamageWithScale : public LayerTreeHostTest { public: - LayerTreeHostTestDamageWithScale() {} + LayerTreeHostTestDamageWithScale() = default; void SetupTree() override { client_.set_fill_with_nonsolid_color(true); @@ -2512,7 +2512,7 @@ // to the impl side. class LayerTreeHostTestCommit : public LayerTreeHostTest { public: - LayerTreeHostTestCommit() {} + LayerTreeHostTestCommit() = default; void BeginTest() override { layer_tree_host()->SetViewportSize(gfx::Size(20, 20)); @@ -2661,7 +2661,7 @@ // from LayerTreeHost to LayerTreeHostImpl in the MT compositor. class LayerTreeHostTestStartPageScaleAnimation : public LayerTreeHostTest { public: - LayerTreeHostTestStartPageScaleAnimation() {} + LayerTreeHostTestStartPageScaleAnimation() = default; void SetupTree() override { LayerTreeHostTest::SetupTree(); @@ -2828,7 +2828,7 @@ class LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers : public LayerTreeHostTest { public: - LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers() {} + LayerTreeHostTestDeviceScaleFactorScalesViewportAndLayers() = default; void BeginTest() override { client_.set_fill_with_nonsolid_color(true); @@ -5089,7 +5089,7 @@ class LayerTreeHostTestKeepSwapPromise : public LayerTreeHostTest { public: - LayerTreeHostTestKeepSwapPromise() {} + LayerTreeHostTestKeepSwapPromise() = default; void BeginTest() override { layer_ = SolidColorLayer::Create(); @@ -5181,7 +5181,7 @@ class LayerTreeHostTestKeepSwapPromiseMFBA : public LayerTreeHostTest { public: - LayerTreeHostTestKeepSwapPromiseMFBA() {} + LayerTreeHostTestKeepSwapPromiseMFBA() = default; void InitializeSettings(LayerTreeSettings* settings) override { settings->main_frame_before_activation_enabled = true; @@ -5348,7 +5348,7 @@ layer_tree_host_impl), set_needs_commit_count_(set_needs_commit_count) {} - ~SimpleSwapPromiseMonitor() override {} + ~SimpleSwapPromiseMonitor() override = default; void OnSetNeedsCommitOnMain() override { (*set_needs_commit_count_)++; } @@ -5366,7 +5366,7 @@ class LayerTreeHostTestSwapPromiseDuringCommit : public LayerTreeHostTest { protected: - LayerTreeHostTestSwapPromiseDuringCommit() {} + LayerTreeHostTestSwapPromiseDuringCommit() = default; void WillBeginMainFrame() override { if (TestEnded()) @@ -6518,7 +6518,7 @@ class RasterizeWithGpuRasterizationCreatesResources : public LayerTreeHostTest { protected: - RasterizeWithGpuRasterizationCreatesResources() {} + RasterizeWithGpuRasterizationCreatesResources() = default; void InitializeSettings(LayerTreeSettings* settings) override { settings->gpu_rasterization_forced = true;
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index 6beaed50..9e7cef7eb9 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc
@@ -779,7 +779,7 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationTakeover : public LayerTreeHostAnimationTest { public: - LayerTreeHostAnimationTestScrollOffsetAnimationTakeover() {} + LayerTreeHostAnimationTestScrollOffsetAnimationTakeover() = default; void SetupTree() override { LayerTreeHostAnimationTest::SetupTree(); @@ -839,7 +839,7 @@ class LayerTreeHostAnimationTestScrollOffsetAnimationAdjusted : public LayerTreeHostAnimationTest { public: - LayerTreeHostAnimationTestScrollOffsetAnimationAdjusted() {} + LayerTreeHostAnimationTestScrollOffsetAnimationAdjusted() = default; void SetupTree() override { LayerTreeHostAnimationTest::SetupTree();
diff --git a/cc/trees/layer_tree_host_unittest_proxy.cc b/cc/trees/layer_tree_host_unittest_proxy.cc index 12e0283..9d207e79 100644 --- a/cc/trees/layer_tree_host_unittest_proxy.cc +++ b/cc/trees/layer_tree_host_unittest_proxy.cc
@@ -37,8 +37,8 @@ class LayerTreeHostProxyTestSetNeedsCommit : public LayerTreeHostProxyTest { protected: - LayerTreeHostProxyTestSetNeedsCommit() {} - ~LayerTreeHostProxyTestSetNeedsCommit() override {} + LayerTreeHostProxyTestSetNeedsCommit() = default; + ~LayerTreeHostProxyTestSetNeedsCommit() override = default; void BeginTest() override { EXPECT_EQ(ProxyMain::NO_PIPELINE_STAGE, @@ -74,8 +74,8 @@ class LayerTreeHostProxyTestSetNeedsAnimate : public LayerTreeHostProxyTest { protected: - LayerTreeHostProxyTestSetNeedsAnimate() {} - ~LayerTreeHostProxyTestSetNeedsAnimate() override {} + LayerTreeHostProxyTestSetNeedsAnimate() = default; + ~LayerTreeHostProxyTestSetNeedsAnimate() override = default; void BeginTest() override { EXPECT_EQ(ProxyMain::NO_PIPELINE_STAGE, @@ -110,8 +110,8 @@ class LayerTreeHostProxyTestSetNeedsUpdateLayers : public LayerTreeHostProxyTest { protected: - LayerTreeHostProxyTestSetNeedsUpdateLayers() {} - ~LayerTreeHostProxyTestSetNeedsUpdateLayers() override {} + LayerTreeHostProxyTestSetNeedsUpdateLayers() = default; + ~LayerTreeHostProxyTestSetNeedsUpdateLayers() override = default; void BeginTest() override { EXPECT_EQ(ProxyMain::NO_PIPELINE_STAGE, @@ -146,8 +146,9 @@ class LayerTreeHostProxyTestSetNeedsUpdateLayersWhileAnimating : public LayerTreeHostProxyTest { protected: - LayerTreeHostProxyTestSetNeedsUpdateLayersWhileAnimating() {} - ~LayerTreeHostProxyTestSetNeedsUpdateLayersWhileAnimating() override {} + LayerTreeHostProxyTestSetNeedsUpdateLayersWhileAnimating() = default; + ~LayerTreeHostProxyTestSetNeedsUpdateLayersWhileAnimating() override = + default; void BeginTest() override { proxy()->SetNeedsAnimate(); } @@ -191,8 +192,8 @@ class LayerTreeHostProxyTestSetNeedsCommitWhileAnimating : public LayerTreeHostProxyTest { protected: - LayerTreeHostProxyTestSetNeedsCommitWhileAnimating() {} - ~LayerTreeHostProxyTestSetNeedsCommitWhileAnimating() override {} + LayerTreeHostProxyTestSetNeedsCommitWhileAnimating() = default; + ~LayerTreeHostProxyTestSetNeedsCommitWhileAnimating() override = default; void BeginTest() override { proxy()->SetNeedsAnimate(); }
diff --git a/cc/trees/layer_tree_host_unittest_scroll.cc b/cc/trees/layer_tree_host_unittest_scroll.cc index 8298948..dfb0831 100644 --- a/cc/trees/layer_tree_host_unittest_scroll.cc +++ b/cc/trees/layer_tree_host_unittest_scroll.cc
@@ -1117,7 +1117,7 @@ class LayerTreeHostScrollTestScrollZeroMaxScrollOffset : public LayerTreeHostScrollTest { public: - LayerTreeHostScrollTestScrollZeroMaxScrollOffset() {} + LayerTreeHostScrollTestScrollZeroMaxScrollOffset() = default; void BeginTest() override { outer_viewport_container_layer_id_ = @@ -1190,7 +1190,7 @@ class LayerTreeHostScrollTestScrollNonDrawnLayer : public LayerTreeHostScrollTest { public: - LayerTreeHostScrollTestScrollNonDrawnLayer() {} + LayerTreeHostScrollTestScrollNonDrawnLayer() = default; void BeginTest() override { PostSetNeedsCommitToMainThread(); } @@ -1240,7 +1240,7 @@ class LayerTreeHostScrollTestImplScrollUnderMainThreadScrollingParent : public LayerTreeHostScrollTest { public: - LayerTreeHostScrollTestImplScrollUnderMainThreadScrollingParent() {} + LayerTreeHostScrollTestImplScrollUnderMainThreadScrollingParent() = default; void BeginTest() override { PostSetNeedsCommitToMainThread(); } @@ -1861,7 +1861,7 @@ class MockInputHandlerClient : public InputHandlerClient { public: - MockInputHandlerClient() {} + MockInputHandlerClient() = default; MOCK_METHOD0(ReconcileElasticOverscrollAndRootScroll, void());
diff --git a/cc/trees/occlusion.cc b/cc/trees/occlusion.cc index e86a1a05..d0f5f1f5 100644 --- a/cc/trees/occlusion.cc +++ b/cc/trees/occlusion.cc
@@ -9,8 +9,7 @@ namespace cc { -Occlusion::Occlusion() { -} +Occlusion::Occlusion() = default; Occlusion::Occlusion(const gfx::Transform& draw_transform, const SimpleEnclosedRegion& occlusion_from_outside_target,
diff --git a/cc/trees/occlusion_tracker.cc b/cc/trees/occlusion_tracker.cc index 3b5e2aa9..906eab9 100644 --- a/cc/trees/occlusion_tracker.cc +++ b/cc/trees/occlusion_tracker.cc
@@ -23,8 +23,7 @@ : screen_space_clip_rect_(screen_space_clip_rect) { } -OcclusionTracker::~OcclusionTracker() { -} +OcclusionTracker::~OcclusionTracker() = default; Occlusion OcclusionTracker::GetCurrentOcclusionForLayer( const gfx::Transform& draw_transform) const {
diff --git a/cc/trees/property_animation_state.cc b/cc/trees/property_animation_state.cc index 92f4b99d..b82efc7 100644 --- a/cc/trees/property_animation_state.cc +++ b/cc/trees/property_animation_state.cc
@@ -8,14 +8,12 @@ namespace cc { -PropertyAnimationState::PropertyAnimationState() {} +PropertyAnimationState::PropertyAnimationState() = default; PropertyAnimationState::PropertyAnimationState( - const PropertyAnimationState& rhs) - : currently_running(rhs.currently_running), - potentially_animating(rhs.potentially_animating) {} + const PropertyAnimationState& rhs) = default; -PropertyAnimationState::~PropertyAnimationState() {} +PropertyAnimationState::~PropertyAnimationState() = default; bool PropertyAnimationState::operator==( const PropertyAnimationState& other) const {
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc index f09843a..7b32a01d2 100644 --- a/cc/trees/property_tree.cc +++ b/cc/trees/property_tree.cc
@@ -37,7 +37,7 @@ // but due to a gcc bug the generated destructor will have wrong symbol // visibility in component build. template <typename T> -PropertyTree<T>::~PropertyTree() {} +PropertyTree<T>::~PropertyTree() = default; template <typename T> PropertyTree<T>& PropertyTree<T>::operator=(const PropertyTree<T>&) = default; @@ -735,7 +735,7 @@ render_surfaces_.push_back(nullptr); } -EffectTree::~EffectTree() {} +EffectTree::~EffectTree() = default; int EffectTree::Insert(const EffectNode& tree_node, int parent_id) { int node_id = PropertyTree<EffectNode>::Insert(tree_node, parent_id); @@ -1160,7 +1160,7 @@ : currently_scrolling_node_id_(kInvalidNodeId), scroll_offset_map_(ScrollTree::ScrollOffsetMap()) {} -ScrollTree::~ScrollTree() {} +ScrollTree::~ScrollTree() = default; ScrollTree& ScrollTree::operator=(const ScrollTree& from) { PropertyTree::operator=(from); @@ -1587,7 +1587,7 @@ animation_scales.clear(); } -PropertyTreesCachedData::~PropertyTreesCachedData() {} +PropertyTreesCachedData::~PropertyTreesCachedData() = default; PropertyTrees::PropertyTrees() : needs_rebuild(true), @@ -1603,7 +1603,7 @@ scroll_tree.SetPropertyTrees(this); } -PropertyTrees::~PropertyTrees() {} +PropertyTrees::~PropertyTrees() = default; bool PropertyTrees::operator==(const PropertyTrees& other) const { return transform_tree == other.transform_tree &&
diff --git a/cc/trees/proxy_common.cc b/cc/trees/proxy_common.cc index ab9c87b..f80fd35 100644 --- a/cc/trees/proxy_common.cc +++ b/cc/trees/proxy_common.cc
@@ -8,8 +8,8 @@ namespace cc { -BeginMainFrameAndCommitState::BeginMainFrameAndCommitState() {} +BeginMainFrameAndCommitState::BeginMainFrameAndCommitState() = default; -BeginMainFrameAndCommitState::~BeginMainFrameAndCommitState() {} +BeginMainFrameAndCommitState::~BeginMainFrameAndCommitState() = default; } // namespace cc
diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc index 567b220..ef06407b 100644 --- a/cc/trees/proxy_impl.cc +++ b/cc/trees/proxy_impl.cc
@@ -88,7 +88,7 @@ ProxyImpl::BlockedMainCommitOnly::BlockedMainCommitOnly() : layer_tree_host(nullptr) {} -ProxyImpl::BlockedMainCommitOnly::~BlockedMainCommitOnly() {} +ProxyImpl::BlockedMainCommitOnly::~BlockedMainCommitOnly() = default; ProxyImpl::~ProxyImpl() { TRACE_EVENT0("cc", "ProxyImpl::~ProxyImpl");
diff --git a/cc/trees/swap_promise_manager.cc b/cc/trees/swap_promise_manager.cc index 124e2b3b..939cc02d 100644 --- a/cc/trees/swap_promise_manager.cc +++ b/cc/trees/swap_promise_manager.cc
@@ -9,7 +9,7 @@ namespace cc { -SwapPromiseManager::SwapPromiseManager() {} +SwapPromiseManager::SwapPromiseManager() = default; SwapPromiseManager::~SwapPromiseManager() { DCHECK(swap_promise_monitors_.empty());
diff --git a/cc/trees/swap_promise_manager_unittest.cc b/cc/trees/swap_promise_manager_unittest.cc index 02f4df2..59bd0980 100644 --- a/cc/trees/swap_promise_manager_unittest.cc +++ b/cc/trees/swap_promise_manager_unittest.cc
@@ -18,7 +18,7 @@ public: explicit MockSwapPromiseMonitor(SwapPromiseManager* manager) : SwapPromiseMonitor(manager, nullptr) {} - ~MockSwapPromiseMonitor() override {} + ~MockSwapPromiseMonitor() override = default; MOCK_METHOD0(OnSetNeedsCommitOnMain, void()); void OnSetNeedsRedrawOnImpl() override {} @@ -27,8 +27,8 @@ class MockSwapPromise : public SwapPromise { public: - MockSwapPromise() {} - ~MockSwapPromise() override {} + MockSwapPromise() = default; + ~MockSwapPromise() override = default; void DidActivate() override {} void WillSwap(viz::CompositorFrameMetadata* metadata) override {}
diff --git a/cc/trees/transform_node.cc b/cc/trees/transform_node.cc index 5183bae..5e7b6bf 100644 --- a/cc/trees/transform_node.cc +++ b/cc/trees/transform_node.cc
@@ -119,7 +119,7 @@ TransformCachedNodeData::TransformCachedNodeData( const TransformCachedNodeData& other) = default; -TransformCachedNodeData::~TransformCachedNodeData() {} +TransformCachedNodeData::~TransformCachedNodeData() = default; bool TransformCachedNodeData::operator==( const TransformCachedNodeData& other) const {
diff --git a/cc/trees/tree_synchronizer_unittest.cc b/cc/trees/tree_synchronizer_unittest.cc index 2afcaa6..98f3b049 100644 --- a/cc/trees/tree_synchronizer_unittest.cc +++ b/cc/trees/tree_synchronizer_unittest.cc
@@ -84,7 +84,7 @@ private: explicit MockLayer(std::vector<int>* layer_impl_destruction_list) : layer_impl_destruction_list_(layer_impl_destruction_list) {} - ~MockLayer() override {} + ~MockLayer() override = default; std::vector<int>* layer_impl_destruction_list_; };
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java index 810c274b..0db59b1 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java
@@ -389,8 +389,11 @@ */ static boolean isLocationDisabledForUrl(Uri uri, boolean isIncognito) { boolean enabled = - WebsitePreferenceBridge.shouldUseDSEGeolocationSetting(uri.toString(), isIncognito) - && WebsitePreferenceBridge.getDSEGeolocationSetting(); + // TODO(raymes): The call to arePermissionsControlledByDSE is only needed if this + // could be called for an origin that isn't the default search engine. Otherwise + // remove this line. + WebsitePreferenceBridge.arePermissionsControlledByDSE(uri.toString(), isIncognito) + && locationContentSettingForUrl(uri, isIncognito) == ContentSetting.ALLOW; return !enabled; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java index 7d1f1fb..e1cbfb8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java
@@ -677,7 +677,7 @@ + permission.type; } if (permission.type == ContentSettingsType.CONTENT_SETTINGS_TYPE_GEOLOCATION - && WebsitePreferenceBridge.shouldUseDSEGeolocationSetting(mFullUrl, false)) { + && WebsitePreferenceBridge.arePermissionsControlledByDSE(mFullUrl, false)) { status_text = statusTextForDSEPermission(permission); } builder.append(status_text);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java index 31c2626..7d436a00 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/SearchEngineAdapter.java
@@ -34,7 +34,6 @@ import org.chromium.chrome.browser.preferences.website.ContentSetting; import org.chromium.chrome.browser.preferences.website.GeolocationInfo; import org.chromium.chrome.browser.preferences.website.SingleWebsitePreferences; -import org.chromium.chrome.browser.preferences.website.WebsitePreferenceBridge; import org.chromium.chrome.browser.search_engines.TemplateUrlService; import org.chromium.chrome.browser.search_engines.TemplateUrlService.TemplateUrl; import org.chromium.components.location.LocationUtils; @@ -458,9 +457,7 @@ // Only show the location setting if it is explicitly enabled or disabled. GeolocationInfo locationSettings = new GeolocationInfo(url, null, false); ContentSetting locationPermission = locationSettings.getContentSetting(); - if (locationPermission != ContentSetting.ASK) return true; - - return WebsitePreferenceBridge.shouldUseDSEGeolocationSetting(url, false); + return locationPermission != ContentSetting.ASK; } private boolean locationEnabled(TemplateUrl templateUrl) { @@ -469,13 +466,6 @@ GeolocationInfo locationSettings = new GeolocationInfo(url, null, false); ContentSetting locationPermission = locationSettings.getContentSetting(); - if (locationPermission == ContentSetting.ASK) { - // Handle the case where the geoHeader being sent when no permission has been specified. - if (WebsitePreferenceBridge.shouldUseDSEGeolocationSetting(url, false)) { - return WebsitePreferenceBridge.getDSEGeolocationSetting(); - } - } - return locationPermission == ContentSetting.ALLOW; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java index 939852e..1ebff007 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java
@@ -616,13 +616,9 @@ private void setUpLocationPreference(Preference preference) { ContentSetting permission = mSite.getGeolocationPermission(); - if (shouldUseDSEGeolocationSetting()) { - String origin = mSite.getAddress().getOrigin(); - mSite.setGeolocationInfo(new GeolocationInfo(origin, origin, false)); - setUpListPreference(preference, ContentSetting.ALLOW); + setUpListPreference(preference, permission); + if (arePermissionsControlledByDSE() && permission != null) { updateLocationPreferenceForDSESetting(preference); - } else { - setUpListPreference(preference, permission); } } @@ -673,12 +669,11 @@ } /** - * Returns true if the DSE (default search engine) geolocation setting should be used for the - * current host. This will be the case when the host is the CCTLD (Country Code Top Level - * Domain) of the DSE, and the DSE supports the X-Geo header. + * Returns true if the DSE (default search engine) geolocation and notifications permissions + * are configured for the DSE. */ - private boolean shouldUseDSEGeolocationSetting() { - return WebsitePreferenceBridge.shouldUseDSEGeolocationSetting( + private boolean arePermissionsControlledByDSE() { + return WebsitePreferenceBridge.arePermissionsControlledByDSE( mSite.getAddress().getOrigin(), false); } @@ -694,8 +689,6 @@ res.getString(R.string.website_settings_permissions_allow_dse), res.getString(R.string.website_settings_permissions_block_dse), }); - listPreference.setValueIndex( - WebsitePreferenceBridge.getDSEGeolocationSetting() ? 0 : 1); } private int getContentSettingsTypeFromPreferenceKey(String preferenceKey) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java index a4ef740..33fdd8d 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
@@ -263,13 +263,8 @@ * Configure geolocation access setting for this site. */ public void setGeolocationPermission(ContentSetting value) { - if (WebsitePreferenceBridge.shouldUseDSEGeolocationSetting( - mOrigin.getOrigin(), false)) { - WebsitePreferenceBridge.setDSEGeolocationSetting(value != ContentSetting.BLOCK); - } else { - if (mGeolocationInfo != null) { - mGeolocationInfo.setContentSetting(value); - } + if (mGeolocationInfo != null) { + mGeolocationInfo.setContentSetting(value); } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java index 4e42b9d9..ce2e077 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java
@@ -218,26 +218,11 @@ } /** - * Returns whether the DSE (Default Search Engine) geolocation setting should be used to - * determine geolocation access for the given origin. + * Returns whether the DSE (Default Search Engine) controls the geolocation + * and notifications settings for the given origin. */ - public static boolean shouldUseDSEGeolocationSetting( - String origin, boolean isIncognito) { - return nativeShouldUseDSEGeolocationSetting(origin, isIncognito); - } - - /** - * Returns the DSE (Default Search Engine) geolocation setting. - */ - public static boolean getDSEGeolocationSetting() { - return nativeGetDSEGeolocationSetting(); - } - - /** - * Sets the DSE (Default Search Engine) geolocation setting. - */ - public static void setDSEGeolocationSetting(boolean setting) { - nativeSetDSEGeolocationSetting(setting); + public static boolean arePermissionsControlledByDSE(String origin, boolean isIncognito) { + return nativeArePermissionsControlledByDSE(origin, isIncognito); } /** @@ -289,9 +274,7 @@ static native void nativeGetUsbOrigins(Object list); static native void nativeRevokeUsbPermission(String origin, String embedder, String object); static native void nativeClearBannerData(String origin); - private static native boolean nativeShouldUseDSEGeolocationSetting( + private static native boolean nativeArePermissionsControlledByDSE( String origin, boolean isIncognito); - private static native boolean nativeGetDSEGeolocationSetting(); - private static native void nativeSetDSEGeolocationSetting(boolean setting); private static native boolean nativeGetAdBlockingActivated(String origin); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/engagement/SiteEngagementServiceTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/engagement/SiteEngagementServiceTest.java index af36673f..e0d9a5b 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/engagement/SiteEngagementServiceTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/engagement/SiteEngagementServiceTest.java
@@ -41,7 +41,7 @@ mActivityTestRule.runOnUiThread(new Runnable() { @Override public void run() { - final String url = "https://www.google.com"; + final String url = "https://www.example.com"; SiteEngagementService service = SiteEngagementService.getForProfile( mActivityTestRule.getActivity().getActivityTab().getProfile()); @@ -65,7 +65,7 @@ mActivityTestRule.runOnUiThread(new Runnable() { @Override public void run() { - final String url = "https://www.google.com"; + final String url = "https://www.example.com"; Profile profile = mActivityTestRule.getActivity().getActivityTab().getProfile(); Assert.assertEquals(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBarTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBarTest.java index 07b991f..c333dad9 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBarTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/infobar/SearchGeolocationDisclosureInfoBarTest.java
@@ -14,12 +14,15 @@ import org.junit.Test; import org.junit.runner.RunWith; +import org.chromium.base.ThreadUtils; import org.chromium.base.metrics.RecordHistogram; import org.chromium.base.test.util.CommandLineFlags; import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.ChromeActivity; import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.SearchGeolocationDisclosureTabHelper; +import org.chromium.chrome.browser.preferences.website.ContentSetting; +import org.chromium.chrome.browser.preferences.website.GeolocationInfo; import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; import org.chromium.chrome.test.util.InfoBarTestAnimationListener; @@ -46,6 +49,10 @@ public void setUp() throws Exception { mActivityTestRule.startMainActivityOnBlankPage(); mTestServer = EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext()); + // Simulate the DSE being granted location (the test server isn't set to be the DSE). + GeolocationInfo locationSettings = + new GeolocationInfo(mTestServer.getURL(SEARCH_PAGE), null, false); + ThreadUtils.runOnUiThread(() -> locationSettings.setContentSetting(ContentSetting.ALLOW)); } @After
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java index c14410b6..f08577c3 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderTest.java
@@ -26,7 +26,6 @@ import org.chromium.chrome.browser.ChromeSwitches; import org.chromium.chrome.browser.preferences.website.ContentSetting; import org.chromium.chrome.browser.preferences.website.GeolocationInfo; -import org.chromium.chrome.browser.preferences.website.WebsitePreferenceBridge; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.test.ChromeActivityTestRule; import org.chromium.chrome.test.ChromeJUnit4ClassRunner; @@ -90,15 +89,13 @@ @SmallTest @Feature({"Location"}) @CommandLineFlags.Add({GOOGLE_BASE_URL_SWITCH}) - public void testPermissionAndSetting() { + public void testPermission() { long now = setMockLocationNow(); - // X-Geo shouldn't be sent when location is disallowed for the origin, or when the DSE - // geolocation setting is off. - checkHeaderWithPermissionAndSetting(ContentSetting.ALLOW, true, now, false); - checkHeaderWithPermissionAndSetting(ContentSetting.DEFAULT, true, now, false); - checkHeaderWithPermissionAndSetting(ContentSetting.DEFAULT, false, now, true); - checkHeaderWithPermissionAndSetting(ContentSetting.BLOCK, false, now, true); + // X-Geo shouldn't be sent when location is disallowed for the origin. + checkHeaderWithPermission(ContentSetting.ALLOW, now, false); + checkHeaderWithPermission(ContentSetting.DEFAULT, now, true); + checkHeaderWithPermission(ContentSetting.BLOCK, now, true); } @Test @@ -153,31 +150,14 @@ assertNonNullHeader(SEARCH_URL_1, false, now); } - private void checkHeaderWithPermissions(final ContentSetting httpsPermission, + private void checkHeaderWithPermission(final ContentSetting httpsPermission, final long locationTime, final boolean shouldBeNull) { ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { GeolocationInfo infoHttps = - new GeolocationInfo("https://www.google.de", null, false); - infoHttps.setContentSetting(httpsPermission); - String header = GeolocationHeader.getGeoHeader( - "https://www.google.de/search?q=kartoffelsalat", - mActivityTestRule.getActivity().getActivityTab()); - assertHeaderState(header, locationTime, shouldBeNull); - } - }); - } - - private void checkHeaderWithPermissionAndSetting(final ContentSetting httpsPermission, - final boolean settingValue, final long locationTime, final boolean shouldBeNull) { - ThreadUtils.runOnUiThreadBlocking(new Runnable() { - @Override - public void run() { - GeolocationInfo infoHttps = new GeolocationInfo(SEARCH_URL_1, null, false); infoHttps.setContentSetting(httpsPermission); - WebsitePreferenceBridge.setDSEGeolocationSetting(settingValue); String header = GeolocationHeader.getGeoHeader( SEARCH_URL_1, mActivityTestRule.getActivity().getActivityTab()); assertHeaderState(header, locationTime, shouldBeNull);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PreferencesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PreferencesTest.java index 91cdf63..f56a265e 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PreferencesTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/PreferencesTest.java
@@ -139,11 +139,12 @@ ContentSetting.ASK, locationPermissionForSearchEngine(keyword2)); // Make sure a pre-existing ALLOW value does not get deleted when switching away - // from a search engine. For this to work we need to change the DSE setting to true - // for search engine 3 before changing to search engine 2. Otherwise the false DSE - // setting will cause the content setting for search engine 2 to be reset when we - // switch to it. - WebsitePreferenceBridge.setDSEGeolocationSetting(true); + // from a search engine. For this to work we need to change the DSE's content + // setting to allow for search engine 3 before changing to search engine 2. + // Otherwise the block setting will cause the content setting for search engine 2 + // to be reset when we switch to it. + WebsitePreferenceBridge.nativeSetGeolocationSettingForOrigin( + url, url, ContentSetting.ALLOW.toInt(), false); keyword2 = pref.getKeywordFromIndexForTesting(2); url = templateUrlService.getSearchEngineUrlFromTemplateUrl(keyword2); WebsitePreferenceBridge.nativeSetGeolocationSettingForOrigin(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTest.java index 275d63a..833d965 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferencesTest.java
@@ -35,6 +35,8 @@ import org.chromium.chrome.browser.preferences.PrefServiceBridge; import org.chromium.chrome.browser.preferences.Preferences; import org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataPreferences.DialogOption; +import org.chromium.chrome.browser.preferences.website.ContentSetting; +import org.chromium.chrome.browser.preferences.website.NotificationInfo; import org.chromium.chrome.browser.webapps.TestFetchStorageCallback; import org.chromium.chrome.browser.webapps.WebappDataStorage; import org.chromium.chrome.browser.webapps.WebappRegistry; @@ -72,6 +74,17 @@ mActivityTestRule.startMainActivityOnBlankPage(); mTestServer = EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext()); + + // Disable notifications for the default search engine so that it doesn't interfere with + // important sites tests. + NotificationInfo notificationSettings = + new NotificationInfo("https://www.google.com", null, false); + // Due to Android notification channels we need to delete the existing content setting in + // in order to change it to block. + ThreadUtils.runOnUiThread( + () -> notificationSettings.setContentSetting(ContentSetting.DEFAULT)); + ThreadUtils.runOnUiThread( + () -> notificationSettings.setContentSetting(ContentSetting.BLOCK)); } @After
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderUnitTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderUnitTest.java index b6fe2a1..e1bc0c00 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderUnitTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeaderUnitTest.java
@@ -31,6 +31,7 @@ import org.chromium.chrome.browser.omnibox.geo.GeolocationHeaderUnitTest.ShadowWebsitePreferenceBridge; import org.chromium.chrome.browser.omnibox.geo.VisibleNetworks.VisibleCell; import org.chromium.chrome.browser.omnibox.geo.VisibleNetworks.VisibleWifi; +import org.chromium.chrome.browser.preferences.website.ContentSetting; import org.chromium.chrome.browser.preferences.website.WebsitePreferenceBridge; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.util.UrlUtilities; @@ -305,13 +306,14 @@ @Implements(WebsitePreferenceBridge.class) public static class ShadowWebsitePreferenceBridge { @Implementation - public static boolean shouldUseDSEGeolocationSetting(String origin, boolean isIncognito) { + public static boolean arePermissionsControlledByDSE(String origin, boolean isIncognito) { return true; } @Implementation - public static boolean getDSEGeolocationSetting() { - return true; + public static int nativeGetGeolocationSettingForOrigin( + String origin, String embedder, boolean isIncognito) { + return ContentSetting.ALLOW.toInt(); } }
diff --git a/chrome/app/chrome_command_ids.h b/chrome/app/chrome_command_ids.h index 094ff3c7..89aace05 100644 --- a/chrome/app/chrome_command_ids.h +++ b/chrome/app/chrome_command_ids.h
@@ -76,6 +76,7 @@ #define IDC_COPY_URL 34060 #define IDC_OPEN_IN_CHROME 34061 #define IDC_SITE_SETTINGS 34062 +#define IDC_APP_INFO 34063 // Page-related commands #define IDC_BOOKMARK_PAGE 35000
diff --git a/chrome/browser/android/preferences/website_preference_bridge.cc b/chrome/browser/android/preferences/website_preference_bridge.cc index 3033940e1..f1316ea 100644 --- a/chrome/browser/android/preferences/website_preference_bridge.cc +++ b/chrome/browser/android/preferences/website_preference_bridge.cc
@@ -183,26 +183,6 @@ jembedder); } } - - // Add the DSE origin if it allows geolocation. - if (content_type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { - SearchPermissionsService* search_helper = - SearchPermissionsService::Factory::GetForBrowserContext( - GetActiveUserProfile(false /* is_incognito */)); - if (search_helper) { - const url::Origin& dse_origin = search_helper->GetDSEOriginIfEnabled(); - if (!dse_origin.unique()) { - std::string dse_origin_string = dse_origin.Serialize(); - if (!base::ContainsValue(seen_origins, dse_origin_string)) { - seen_origins.push_back(dse_origin_string); - insertionFunc(env, list, - JNI_WebsitePreferenceBridge_ConvertOriginToJavaString( - env, dse_origin_string), - jembedder); - } - } - } - } } ContentSetting JNI_WebsitePreferenceBridge_GetSettingForOrigin( @@ -816,7 +796,7 @@ CONTENT_SETTINGS_TYPE_APP_BANNER, std::string(), nullptr); } -static jboolean JNI_WebsitePreferenceBridge_ShouldUseDSEGeolocationSetting( +static jboolean JNI_WebsitePreferenceBridge_ArePermissionsControlledByDSE( JNIEnv* env, const JavaParamRef<jclass>& clazz, const JavaParamRef<jstring>& jorigin, @@ -825,29 +805,10 @@ SearchPermissionsService::Factory::GetForBrowserContext( GetActiveUserProfile(is_incognito)); return search_helper && - search_helper->UseDSEGeolocationSetting( + search_helper->ArePermissionsControlledByDSE( url::Origin::Create(GURL(ConvertJavaStringToUTF8(env, jorigin)))); } -static jboolean JNI_WebsitePreferenceBridge_GetDSEGeolocationSetting( - JNIEnv* env, - const JavaParamRef<jclass>& clazz) { - SearchPermissionsService* search_helper = - SearchPermissionsService::Factory::GetForBrowserContext( - GetActiveUserProfile(false /* is_incognito */)); - return search_helper->GetDSEGeolocationSetting(); -} - -static void JNI_WebsitePreferenceBridge_SetDSEGeolocationSetting( - JNIEnv* env, - const JavaParamRef<jclass>& clazz, - jboolean setting) { - SearchPermissionsService* search_helper = - SearchPermissionsService::Factory::GetForBrowserContext( - GetActiveUserProfile(false /* is_incognito */)); - return search_helper->SetDSEGeolocationSetting(setting); -} - static jboolean JNI_WebsitePreferenceBridge_GetAdBlockingActivated( JNIEnv* env, const JavaParamRef<jclass>& clazz,
diff --git a/chrome/browser/android/search_permissions/search_geolocation_disclosure_tab_helper.cc b/chrome/browser/android/search_permissions/search_geolocation_disclosure_tab_helper.cc index 493fb04..d16a8937 100644 --- a/chrome/browser/android/search_permissions/search_geolocation_disclosure_tab_helper.cc +++ b/chrome/browser/android/search_permissions/search_geolocation_disclosure_tab_helper.cc
@@ -14,6 +14,8 @@ #include "chrome/browser/android/search_permissions/search_geolocation_disclosure_infobar_delegate.h" #include "chrome/browser/android/search_permissions/search_permissions_service.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" +#include "chrome/browser/permissions/permission_manager.h" +#include "chrome/browser/permissions/permission_result.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" @@ -143,20 +145,12 @@ // shown. RecordPreDisclosureMetrics(gurl); - // Only show the disclosure if the geolocation permission is set ask (i.e. has - // not been explicitly set or revoked). - ContentSetting status = - HostContentSettingsMapFactory::GetForProfile(GetProfile()) - ->GetContentSetting(gurl, gurl, CONTENT_SETTINGS_TYPE_GEOLOCATION, - std::string()); - if (status != CONTENT_SETTING_ASK) + // Only show disclosure if the DSE geolocation setting is on. + if (PermissionManager::Get(GetProfile()) + ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_GEOLOCATION, gurl, gurl) + .content_setting != CONTENT_SETTING_ALLOW) { return; - - // And only show disclosure if the DSE geolocation setting is on. - SearchPermissionsService* service = - SearchPermissionsService::Factory::GetForBrowserContext(GetProfile()); - if (!service->GetDSEGeolocationSetting()) - return; + } // Check that the Chrome app has geolocation permission. JNIEnv* env = base::android::AttachCurrentThread(); @@ -190,7 +184,7 @@ if (gIgnoreUrlChecksForTesting) return true; - return service->UseDSEGeolocationSetting(url::Origin::Create(gurl)); + return service->ArePermissionsControlledByDSE(url::Origin::Create(gurl)); } bool SearchGeolocationDisclosureTabHelper::ShouldShowDisclosureForNavigation( @@ -224,16 +218,9 @@ HostContentSettingsMapFactory::GetForProfile(GetProfile()) ->GetContentSetting(gurl, gurl, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()); - UMA_HISTOGRAM_ENUMERATION( - "GeolocationDisclosure.PreDisclosureContentSetting", - static_cast<base::HistogramBase::Sample>(status), - static_cast<base::HistogramBase::Sample>(CONTENT_SETTING_NUM_SETTINGS) + - 1); - SearchPermissionsService* service = - SearchPermissionsService::Factory::GetForBrowserContext(GetProfile()); UMA_HISTOGRAM_BOOLEAN("GeolocationDisclosure.PreDisclosureDSESetting", - service->GetDSEGeolocationSetting()); + status == CONTENT_SETTING_ALLOW); prefs->SetBoolean(prefs::kSearchGeolocationPreDisclosureMetricsRecorded, true); @@ -249,16 +236,9 @@ HostContentSettingsMapFactory::GetForProfile(GetProfile()) ->GetContentSetting(gurl, gurl, CONTENT_SETTINGS_TYPE_GEOLOCATION, std::string()); - UMA_HISTOGRAM_ENUMERATION( - "GeolocationDisclosure.PostDisclosureContentSetting", - static_cast<base::HistogramBase::Sample>(status), - static_cast<base::HistogramBase::Sample>(CONTENT_SETTING_NUM_SETTINGS) + - 1); - SearchPermissionsService* service = - SearchPermissionsService::Factory::GetForBrowserContext(GetProfile()); UMA_HISTOGRAM_BOOLEAN("GeolocationDisclosure.PostDisclosureDSESetting", - service->GetDSEGeolocationSetting()); + status == CONTENT_SETTING_ALLOW); prefs->SetBoolean(prefs::kSearchGeolocationPostDisclosureMetricsRecorded, true);
diff --git a/chrome/browser/android/search_permissions/search_permissions_service.cc b/chrome/browser/android/search_permissions/search_permissions_service.cc index d0363730..f46aef8338 100644 --- a/chrome/browser/android/search_permissions/search_permissions_service.cc +++ b/chrome/browser/android/search_permissions/search_permissions_service.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/android/search_permissions/search_permissions_service.h" #include "base/callback.h" +#include "base/feature_list.h" #include "base/values.h" #include "chrome/browser/android/search_permissions/search_geolocation_disclosure_tab_helper.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" @@ -12,6 +13,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "components/content_settings/core/browser/content_settings_utils.h" #include "components/content_settings/core/browser/host_content_settings_map.h" @@ -27,8 +29,11 @@ namespace { -const char kDSESettingKey[] = "dse_setting"; const char kDSENameKey[] = "dse_name"; +const char kDSEOriginKey[] = "dse_origin"; +const char kDSEGeolocationSettingKey[] = "geolocation_setting_to_restore"; +const char kDSENotificationsSettingKey[] = "notifications_setting_to_restore"; +const char kDSESettingKeyDeprecated[] = "dse_setting"; // Default implementation of SearchEngineDelegate that is used for production // code. @@ -94,7 +99,9 @@ struct SearchPermissionsService::PrefValue { base::string16 dse_name; - bool setting = false; + std::string dse_origin; + ContentSetting geolocation_setting_to_restore; + ContentSetting notifications_setting_to_restore; }; // static @@ -133,7 +140,8 @@ void SearchPermissionsService::Factory::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable* registry) { - registry->RegisterDictionaryPref(prefs::kDSEGeolocationSetting); + registry->RegisterDictionaryPref(prefs::kDSEGeolocationSettingDeprecated); + registry->RegisterDictionaryPref(prefs::kDSEPermissionsSettings); } SearchPermissionsService::SearchPermissionsService(Profile* profile) @@ -148,15 +156,10 @@ delegate_->SetDSEChangedCallback(base::Bind( &SearchPermissionsService::OnDSEChanged, base::Unretained(this))); - InitializeDSEGeolocationSettingIfNeeded(); - - // Make sure the setting is valid now. It's possible that the setting has - // become invalid either by changes being made to enterprise policy, or while - // the flag to enable consistent search geolocation was off. - EnsureDSEGeolocationSettingIsValid(); + InitializeSettingsIfNeeded(); } -bool SearchPermissionsService::UseDSEGeolocationSetting( +bool SearchPermissionsService::ArePermissionsControlledByDSE( const url::Origin& requesting_origin) { if (requesting_origin.scheme() != url::kHttpsScheme) return false; @@ -164,49 +167,9 @@ if (!requesting_origin.IsSameOriginWith(delegate_->GetDSEOrigin())) return false; - // If the content setting for the DSE CCTLD is controlled by policy, and is st - // to ASK, don't use the DSE geolocation setting. - if (!IsContentSettingUserSettable() && - GetCurrentContentSetting() == CONTENT_SETTING_ASK) { - return false; - } - return true; } -bool SearchPermissionsService::GetDSEGeolocationSetting() { - // Make sure the setting is valid, in case enterprise policy has changed. - // TODO(benwells): Check if enterprise policy can change while Chrome is - // running. If it can't this call is probably not needed. - EnsureDSEGeolocationSettingIsValid(); - - return GetDSEGeolocationPref().setting; -} - -void SearchPermissionsService::SetDSEGeolocationSetting(bool setting) { - PrefValue pref = GetDSEGeolocationPref(); - if (setting == pref.setting) - return; - - // If the user cannot change their geolocation content setting (e.g. due to - // enterprise policy), they also can't change this preference so just bail - // out. - if (!IsContentSettingUserSettable()) - return; - - pref.setting = setting; - SetDSEGeolocationPref(pref); - - ResetContentSetting(); -} - -url::Origin SearchPermissionsService::GetDSEOriginIfEnabled() { - url::Origin dse_origin = delegate_->GetDSEOrigin(); - if (UseDSEGeolocationSetting(dse_origin)) - return dse_origin; - return url::Origin(); -} - void SearchPermissionsService::Shutdown() { delegate_.reset(); } @@ -214,104 +177,258 @@ SearchPermissionsService::~SearchPermissionsService() {} void SearchPermissionsService::OnDSEChanged() { - base::string16 new_dse_name = delegate_->GetDSEName(); - PrefValue pref = GetDSEGeolocationPref(); - ContentSetting content_setting = GetCurrentContentSetting(); + InitializeSettingsIfNeeded(); - // Remove any geolocation embargo on the URL. - PermissionDecisionAutoBlocker::GetForProfile(profile_)->RemoveEmbargoByUrl( - delegate_->GetDSEOrigin().GetURL(), CONTENT_SETTINGS_TYPE_GEOLOCATION); - if (content_setting == CONTENT_SETTING_BLOCK && pref.setting) { - pref.setting = false; - } else if (content_setting == CONTENT_SETTING_ALLOW && !pref.setting) { - ResetContentSetting(); + PrefValue pref = GetDSEPref(); + + base::string16 new_dse_name = delegate_->GetDSEName(); + base::string16 old_dse_name = pref.dse_name; + + GURL old_dse_origin(pref.dse_origin); + GURL new_dse_origin = delegate_->GetDSEOrigin().GetURL(); + + // This can happen in tests. + // TODO(raymes): It turns out this can also happen if the DSE is disabled by + // policy. This is another case we need to correctly handle. + if (!new_dse_origin.is_valid()) + return; + + // Don't do anything if the DSE name/origin hasn't changed. + if (old_dse_origin == new_dse_origin) + return; + + ContentSetting geolocation_setting_to_restore = UpdatePermission( + CONTENT_SETTINGS_TYPE_GEOLOCATION, old_dse_origin, new_dse_origin, + pref.geolocation_setting_to_restore, old_dse_name != new_dse_name); + ContentSetting notifications_setting_to_restore = + pref.notifications_setting_to_restore; + // Only update the notifications part of the pref if the feature is enabled. + if (base::FeatureList::IsEnabled(features::kGrantNotificationsToDSE)) { + notifications_setting_to_restore = UpdatePermission( + CONTENT_SETTINGS_TYPE_NOTIFICATIONS, old_dse_origin, new_dse_origin, + pref.notifications_setting_to_restore, old_dse_name != new_dse_name); } - if (new_dse_name != pref.dse_name && pref.setting) - SearchGeolocationDisclosureTabHelper::ResetDisclosure(profile_); - + // Write the pref for restoring the old values when the DSE changes. pref.dse_name = new_dse_name; - SetDSEGeolocationPref(pref); + pref.dse_origin = new_dse_origin.spec(); + pref.geolocation_setting_to_restore = geolocation_setting_to_restore; + pref.notifications_setting_to_restore = notifications_setting_to_restore; + SetDSEPref(pref); } -void SearchPermissionsService::InitializeDSEGeolocationSettingIfNeeded() { - // Initialize the pref if it hasn't been initialized yet. - if (!pref_service_->HasPrefPath(prefs::kDSEGeolocationSetting)) { - ContentSetting content_setting = GetCurrentContentSetting(); +ContentSetting SearchPermissionsService::UpdatePermission( + ContentSettingsType type, + const GURL& old_dse_origin, + const GURL& new_dse_origin, + ContentSetting old_dse_setting_to_restore, + bool dse_name_changed) { + // Remove any embargo on the URL. + PermissionDecisionAutoBlocker::GetForProfile(profile_)->RemoveEmbargoByUrl( + new_dse_origin, type); + + // Read the current value of the old DSE. This is the DSE setting that we want + // to try to apply to the new DSE origin. + ContentSetting dse_setting = GetContentSetting(old_dse_origin, type); + + // The user's setting should never be ASK while an origin is the DSE. There + // should be no way for the user to reset the DSE content setting to ASK. + if (dse_setting == CONTENT_SETTING_ASK) { + // The style guide suggests not to handle cases which are invalid code paths + // however in this case there are security risks to state being invalid so + // we ensure the dse_setting is reverted to BLOCK. + dse_setting = CONTENT_SETTING_BLOCK; + } + + // Restore the setting for the old origin. If the user has changed the setting + // since the origin became the DSE, we reset the setting so the user will be + // prompted. + if (old_dse_setting_to_restore != dse_setting) + old_dse_setting_to_restore = CONTENT_SETTING_ASK; + SetContentSetting(old_dse_origin, type, old_dse_setting_to_restore); + + ContentSetting new_dse_setting_to_restore = + GetContentSetting(new_dse_origin, type); + // If the DSE we're changing to is already blocked, we just leave it in the + // blocked state. + if (new_dse_setting_to_restore != CONTENT_SETTING_BLOCK) { + // If the DSE we're changing to is allowed, but the DSE setting is blocked, + // we change the setting to block, but when we restore the setting, we go + // back to ask. + if (new_dse_setting_to_restore == CONTENT_SETTING_ALLOW && + dse_setting == CONTENT_SETTING_BLOCK) { + SetContentSetting(new_dse_origin, type, CONTENT_SETTING_BLOCK); + new_dse_setting_to_restore = CONTENT_SETTING_ASK; + } else { + SetContentSetting(new_dse_origin, type, dse_setting); + } + } + + // Reset the disclosure if needed. + if (type == CONTENT_SETTINGS_TYPE_GEOLOCATION && dse_name_changed && + dse_setting == CONTENT_SETTING_ALLOW) { + SearchGeolocationDisclosureTabHelper::ResetDisclosure(profile_); + } + + return new_dse_setting_to_restore; +} + +void SearchPermissionsService::InitializeSettingsIfNeeded() { + GURL dse_origin = delegate_->GetDSEOrigin().GetURL(); + + // This can happen in tests or if the DSE is disabled by policy. We defer + // initialization until later. + if (!dse_origin.is_valid()) + return; + + // Initialize the pref for geolocation if it hasn't been initialized yet. + if (!pref_service_->HasPrefPath(prefs::kDSEPermissionsSettings)) { + ContentSetting geolocation_setting_to_restore = + GetContentSetting(dse_origin, CONTENT_SETTINGS_TYPE_GEOLOCATION); + ContentSetting dse_geolocation_setting = geolocation_setting_to_restore; + bool reset_disclosure = true; + // Migrate the old geolocation pref if it exists. + if (pref_service_->HasPrefPath(prefs::kDSEGeolocationSettingDeprecated)) { + // If the DSE geolocation setting is already initialized, it means we've + // already setup the disclosure to be shown so we don't need to do it + // again. + reset_disclosure = false; + + const base::DictionaryValue* dict = + pref_service_->GetDictionary(prefs::kDSEGeolocationSettingDeprecated); + + // If the user's content setting is being overridden by the DSE setting, + // we migrate the DSE setting to be stored in the user's content setting. + bool dse_setting = false; + dict->GetBoolean(kDSESettingKeyDeprecated, &dse_setting); + if (dse_geolocation_setting == CONTENT_SETTING_ASK) { + dse_geolocation_setting = + dse_setting ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK; + } + + // Delete setting. + pref_service_->ClearPref(prefs::kDSEGeolocationSettingDeprecated); + } else if (dse_geolocation_setting == CONTENT_SETTING_ASK) { + // If the user hasn't explicitly allowed or blocked geolocation for the + // DSE, initialize it to allowed. + dse_geolocation_setting = CONTENT_SETTING_ALLOW; + } + + // Update the content setting with the auto-grants for the DSE. + SetContentSetting(dse_origin, CONTENT_SETTINGS_TYPE_GEOLOCATION, + dse_geolocation_setting); + + if (reset_disclosure) + SearchGeolocationDisclosureTabHelper::ResetDisclosure(profile_); PrefValue pref; pref.dse_name = delegate_->GetDSEName(); - pref.setting = content_setting != CONTENT_SETTING_BLOCK; - SetDSEGeolocationPref(pref); + pref.dse_origin = delegate_->GetDSEOrigin().GetURL().spec(); + pref.geolocation_setting_to_restore = geolocation_setting_to_restore; + pref.notifications_setting_to_restore = CONTENT_SETTING_DEFAULT; + SetDSEPref(pref); + } - SearchGeolocationDisclosureTabHelper::ResetDisclosure(profile_); + // Initialize the notifications part of the pref if needed. + PrefValue pref = GetDSEPref(); + if (base::FeatureList::IsEnabled(features::kGrantNotificationsToDSE) && + pref.notifications_setting_to_restore == CONTENT_SETTING_DEFAULT) { + ContentSetting notifications_setting_to_restore = + GetContentSetting(dse_origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS); + ContentSetting dse_notifications_setting = notifications_setting_to_restore; + // If the user hasn't explicitly allowed or blocked notifications for the + // DSE, initialize it to allowed. + if (dse_notifications_setting == CONTENT_SETTING_ASK) + dse_notifications_setting = CONTENT_SETTING_ALLOW; + + // Update the content setting with the auto-grants for the DSE. + SetContentSetting(dse_origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + dse_notifications_setting); + + // Write the pref for restoring the old values when the DSE changes. + pref.notifications_setting_to_restore = notifications_setting_to_restore; + SetDSEPref(pref); + } else if (!base::FeatureList::IsEnabled( + features::kGrantNotificationsToDSE) && + pref.notifications_setting_to_restore != CONTENT_SETTING_DEFAULT) { + // Handle the case where the feature has been disabled. Restore the pref + // value and reset the setting to restore to DEFAULT. + SetContentSetting(dse_origin, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + pref.notifications_setting_to_restore); + pref.notifications_setting_to_restore = CONTENT_SETTING_DEFAULT; + SetDSEPref(pref); } } -void SearchPermissionsService::EnsureDSEGeolocationSettingIsValid() { - PrefValue pref = GetDSEGeolocationPref(); - ContentSetting content_setting = GetCurrentContentSetting(); - bool new_setting = pref.setting; - - if (pref.setting && content_setting == CONTENT_SETTING_BLOCK) { - new_setting = false; - } else if (!pref.setting && content_setting == CONTENT_SETTING_ALLOW) { - new_setting = true; - } - - if (pref.setting != new_setting) { - pref.setting = new_setting; - SetDSEGeolocationPref(pref); - } -} - -SearchPermissionsService::PrefValue -SearchPermissionsService::GetDSEGeolocationPref() { +SearchPermissionsService::PrefValue SearchPermissionsService::GetDSEPref() { const base::DictionaryValue* dict = - pref_service_->GetDictionary(prefs::kDSEGeolocationSetting); + pref_service_->GetDictionary(prefs::kDSEPermissionsSettings); PrefValue pref; base::string16 dse_name; - bool setting; + std::string dse_origin; + int geolocation_setting_to_restore; + int notifications_setting_to_restore; + if (dict->GetString(kDSENameKey, &dse_name) && - dict->GetBoolean(kDSESettingKey, &setting)) { + dict->GetString(kDSEOriginKey, &dse_origin) && + dict->GetInteger(kDSEGeolocationSettingKey, + &geolocation_setting_to_restore) && + dict->GetInteger(kDSENotificationsSettingKey, + ¬ifications_setting_to_restore)) { pref.dse_name = dse_name; - pref.setting = setting; + pref.dse_origin = dse_origin; + pref.geolocation_setting_to_restore = + IntToContentSetting(geolocation_setting_to_restore); + pref.notifications_setting_to_restore = + IntToContentSetting(notifications_setting_to_restore); } return pref; } -void SearchPermissionsService::SetDSEGeolocationPref( +void SearchPermissionsService::SetDSEPref( const SearchPermissionsService::PrefValue& pref) { base::DictionaryValue dict; dict.SetString(kDSENameKey, pref.dse_name); - dict.SetBoolean(kDSESettingKey, pref.setting); - pref_service_->Set(prefs::kDSEGeolocationSetting, dict); + dict.SetString(kDSEOriginKey, pref.dse_origin); + dict.SetInteger(kDSEGeolocationSettingKey, + pref.geolocation_setting_to_restore); + dict.SetInteger(kDSENotificationsSettingKey, + pref.notifications_setting_to_restore); + pref_service_->Set(prefs::kDSEPermissionsSettings, dict); } -ContentSetting SearchPermissionsService::GetCurrentContentSetting() { - url::Origin origin = delegate_->GetDSEOrigin(); - return host_content_settings_map_->GetContentSetting( - origin.GetURL(), origin.GetURL(), CONTENT_SETTINGS_TYPE_GEOLOCATION, - std::string()); +ContentSetting SearchPermissionsService::GetContentSetting( + const GURL& origin, + ContentSettingsType type) { + // TODO(raymes): For this to be correct, it should only query the user-defined + // settings in HostContentSettingsMap. Add a function to do this. + return host_content_settings_map_->GetContentSetting(origin, origin, type, + std::string()); } -void SearchPermissionsService::ResetContentSetting() { - url::Origin origin = delegate_->GetDSEOrigin(); +void SearchPermissionsService::SetContentSetting(const GURL& origin, + ContentSettingsType type, + ContentSetting setting) { + // Clear a setting before setting it. This is needed because in general + // notifications settings can't be changed from ALLOW<->BLOCK on Android O+. + // We need to change the setting from ALLOW->BLOCK in one case, where the + // previous DSE had permission blocked but the new DSE we're changing to has + // permission allowed. Thus this works around that restriction. + // WARNING: This is a special case and in general notification settings should + // never be changed between ALLOW<->BLOCK on Android. Do not copy this code. + // Check with the notifications team if you need to do something like this. host_content_settings_map_->SetContentSettingDefaultScope( - origin.GetURL(), origin.GetURL(), CONTENT_SETTINGS_TYPE_GEOLOCATION, - std::string(), CONTENT_SETTING_DEFAULT); -} + origin, origin, type, std::string(), CONTENT_SETTING_DEFAULT); -bool SearchPermissionsService::IsContentSettingUserSettable() { - content_settings::SettingInfo info; - url::Origin origin = delegate_->GetDSEOrigin(); - std::unique_ptr<base::Value> value = - host_content_settings_map_->GetWebsiteSetting( - origin.GetURL(), origin.GetURL(), CONTENT_SETTINGS_TYPE_GEOLOCATION, - std::string(), &info); - return info.source == content_settings::SETTING_SOURCE_USER; + // If we're restoring an ASK setting, it really implies that we should delete + // the user-defined setting to fall back to the default. + if (setting == CONTENT_SETTING_ASK) + return; // We deleted the setting above already. + + host_content_settings_map_->SetContentSettingDefaultScope( + origin, origin, type, std::string(), setting); } void SearchPermissionsService::SetSearchEngineDelegateForTest(
diff --git a/chrome/browser/android/search_permissions/search_permissions_service.h b/chrome/browser/android/search_permissions/search_permissions_service.h index e57a14e..9cdd689 100644 --- a/chrome/browser/android/search_permissions/search_permissions_service.h +++ b/chrome/browser/android/search_permissions/search_permissions_service.h
@@ -26,8 +26,7 @@ class Profile; // Helper class to manage DSE permissions. It keeps the setting valid by -// watching change to the CCTLD and DSE, and also provides logic for whether the -// setting should be used and it's current value. +// watching change to the CCTLD and DSE. // Glossary: // DSE: Default Search Engine // CCTLD: Country Code Top Level Domain (e.g. google.com.au) @@ -75,19 +74,9 @@ explicit SearchPermissionsService(Profile* profile); - // Returns whether the DSE geolocation setting is applicable for geolocation - // requests for the given top level origin. - bool UseDSEGeolocationSetting(const url::Origin& requesting_origin); - - // Returns the DSE geolocation setting, after applying any updates needed to - // make it valid. - bool GetDSEGeolocationSetting(); - - // Changes the DSE geolocation setting. - void SetDSEGeolocationSetting(bool setting); - - // Returns the DSE's Origin if geolocation enabled, else an unique Origin. - url::Origin GetDSEOriginIfEnabled(); + // Returns whether the geolocation and notifications permissions are being + // configured for the DSE for that given origin. + bool ArePermissionsControlledByDSE(const url::Origin& requesting_origin); // KeyedService: void Shutdown() override; @@ -101,49 +90,44 @@ ~SearchPermissionsService() override; // When the DSE CCTLD changes (either by changing their DSE or by changing - // their CCTLD, and their DSE supports geolocation: - // * If the DSE CCTLD origin permission is BLOCK, but the DSE geolocation - // setting is on, change the DSE geolocation setting to off - // * If the DSE CCTLD origin permission is ALLOW, but the DSE geolocation - // setting is off, reset the DSE CCTLD origin permission to ASK. - // Also, if the previous DSE did not support geolocation, and the new one - // does, and the geolocation setting is on, reset whether the DSE geolocation - // disclosure has been shown. + // their CCTLD) we carry over the geolocation/notification permissions from + // the last DSE CCTLD. Before carrying them over, we store the old value + // of the permissions in a pref so the user's settings can be restored if + // they change DSE in the future. + // We resolve conflicts in the following way: + // * If the DSE CCTLD origin permission is BLOCK, but the old DSE's permission + // is ALLOW, change the DSE permission setting to BLOCK. + // * If the DSE CCTLD origin permission is ALLOW, but the old DSE's permission + // is BLOCK, change the DSE permission setting to BLOCK but restore it to + // ASK later. + // * If the user changes the DSE CCTLD origin permission, we restore it back + // to ASK when they change DSE. + // Also, if the DSE changes and geolocation is enabled, we reset the + // geolocation disclosure so that it will be shown again. void OnDSEChanged(); - // Initialize the DSE geolocation setting if it hasn't already been - // initialized. Also, if it hasn't been initialized, reset whether the DSE + ContentSetting UpdatePermission(ContentSettingsType type, + const GURL& old_dse_origin, + const GURL& new_dse_origin, + ContentSetting old_setting, + bool dse_name_changed); + + // Initialize the DSE permission settings if they haven't already been + // initialized. Also, if they haven't been initialized, reset whether the DSE // geolocation disclosure has been shown to ensure user who may have seen it // on earlier versions (due to Finch experiments) see it again. - void InitializeDSEGeolocationSettingIfNeeded(); + void InitializeSettingsIfNeeded(); - // Check that the DSE geolocation setting is valid with respect to the content - // setting. The rules of vaidity are: - // * If the content setting is BLOCK, the DSE geolocation setting must - // be false. - // * If the content setting is ALLOW, the DSE geolocation setting must be - // true. - // * If the content setting is ASK, the DSE geolocation setting can be true or - // false. - // One way the setting could become invalid is if the feature enabling the - // setting was disabled (via Finch or flags), content settings were changed, - // and the feature enabled again. Or the enterprise policy settings could have - // been updated in a way that makes the setting invalid. - void EnsureDSEGeolocationSettingIsValid(); + PrefValue GetDSEPref(); + void SetDSEPref(const PrefValue& pref); - PrefValue GetDSEGeolocationPref(); - void SetDSEGeolocationPref(const PrefValue& pref); - - // Retrieve the geolocation content setting for the current DSE CCTLD. - ContentSetting GetCurrentContentSetting(); - - // Reset the geolocation content setting for the current DSE CCTLD back to the - // default. - void ResetContentSetting(); - - // Returns whether the user can change the geolocation content setting for the - // current DSE CCTLD. - bool IsContentSettingUserSettable(); + // Retrieve the content setting for the given permission/origin. + ContentSetting GetContentSetting(const GURL& origin, + ContentSettingsType type); + // Set the content setting for the given permission/origin. + void SetContentSetting(const GURL& origin, + ContentSettingsType type, + ContentSetting setting); void SetSearchEngineDelegateForTest( std::unique_ptr<SearchEngineDelegate> delegate);
diff --git a/chrome/browser/android/search_permissions/search_permissions_service_unittest.cc b/chrome/browser/android/search_permissions/search_permissions_service_unittest.cc index d466247..47baa137 100644 --- a/chrome/browser/android/search_permissions/search_permissions_service_unittest.cc +++ b/chrome/browser/android/search_permissions/search_permissions_service_unittest.cc
@@ -10,10 +10,12 @@ #include "base/callback.h" #include "base/memory/ptr_util.h" #include "base/strings/utf_string_conversions.h" +#include "base/test/scoped_feature_list.h" #include "chrome/browser/android/search_permissions/search_geolocation_disclosure_tab_helper.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/permissions/permission_decision_auto_blocker.h" #include "chrome/browser/permissions/permission_result.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/testing_profile.h" #include "components/content_settings/core/browser/host_content_settings_map.h" @@ -26,6 +28,8 @@ namespace { +const char kDSESettingKeyDeprecated[] = "dse_setting"; + const char kGoogleURL[] = "https://www.google.com"; const char kGoogleAusURL[] = "https://www.google.com.au"; const char kGoogleHTTPURL[] = "http://www.google.com"; @@ -39,6 +43,8 @@ class TestSearchEngineDelegate : public SearchPermissionsService::SearchEngineDelegate { public: + TestSearchEngineDelegate() + : dse_origin_(url::Origin::Create(GURL(kGoogleURL))) {} base::string16 GetDSEName() override { if (dse_origin_.host().find("google") != std::string::npos) return base::ASCIIToUTF16("Google"); @@ -66,19 +72,43 @@ class SearchPermissionsServiceTest : public testing::Test { public: + SearchPermissionsServiceTest() { + scoped_feature_list_.InitAndEnableFeature( + features::kGrantNotificationsToDSE); + } + void SetUp() override { profile_.reset(new TestingProfile); + ClearNotificationsChannels(); + auto test_delegate = base::MakeUnique<TestSearchEngineDelegate>(); test_delegate_ = test_delegate.get(); GetService()->SetSearchEngineDelegateForTest(std::move(test_delegate)); + ReinitializeService(true /* clear_pref */); } void TearDown() override { test_delegate_ = nullptr; + + ClearNotificationsChannels(); + profile_.reset(); } + void ClearNotificationsChannels() { + // Because notification channel settings aren't tied to the profile, they + // will persist across tests. We need to make sure they're reset here. + SetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + CONTENT_SETTING_DEFAULT); + SetContentSetting(kGoogleAusURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + CONTENT_SETTING_DEFAULT); + SetContentSetting(kGoogleHTTPURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + CONTENT_SETTING_DEFAULT); + SetContentSetting(kExampleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + CONTENT_SETTING_DEFAULT); + } + TestingProfile* profile() { return profile_.get(); } TestSearchEngineDelegate* test_delegate() { return test_delegate_; } @@ -88,19 +118,30 @@ } void SetContentSetting(const std::string& origin_string, + ContentSettingsType type, ContentSetting setting) { GURL url(origin_string); - HostContentSettingsMapFactory::GetForProfile(profile()) - ->SetContentSettingDefaultScope(url, url, - CONTENT_SETTINGS_TYPE_GEOLOCATION, - std::string(), setting); + HostContentSettingsMap* hcsm = + HostContentSettingsMapFactory::GetForProfile(profile()); + // Clear a setting before setting it. This is needed because in general + // notifications settings can't be changed from ALLOW<->BLOCK on Android O+. + // We need to change the setting from ALLOW->BLOCK in one case, where the + // previous DSE had permission blocked but the new DSE we're changing to has + // permission allowed. Thus this works around that restriction. + // WARNING: This is a special case and in general notification settings + // should never be changed between ALLOW<->BLOCK on Android. Do not copy + // this code. Check with the notifications team if you need to do something + // like this. + hcsm->SetContentSettingDefaultScope(url, url, type, std::string(), + CONTENT_SETTING_DEFAULT); + hcsm->SetContentSettingDefaultScope(url, url, type, std::string(), setting); } - ContentSetting GetContentSetting(const std::string& origin_string) { + ContentSetting GetContentSetting(const std::string& origin_string, + ContentSettingsType type) { GURL url(origin_string); return HostContentSettingsMapFactory::GetForProfile(profile()) - ->GetContentSetting(url, url, CONTENT_SETTINGS_TYPE_GEOLOCATION, - std::string()); + ->GetContentSetting(url, url, type, std::string()); } // Simulates the initialization that happens when recreating the service. If @@ -108,9 +149,16 @@ // created. void ReinitializeService(bool clear_pref) { if (clear_pref) - profile()->GetPrefs()->ClearPref(prefs::kDSEGeolocationSetting); + profile()->GetPrefs()->ClearPref(prefs::kDSEPermissionsSettings); - GetService()->InitializeDSEGeolocationSettingIfNeeded(); + GetService()->InitializeSettingsIfNeeded(); + } + + // Simulate setting the old preference to test migration. + void SetOldPreference(bool setting) { + base::DictionaryValue dict; + dict.SetBoolean(kDSESettingKeyDeprecated, setting); + profile()->GetPrefs()->Set(prefs::kDSEGeolocationSettingDeprecated, dict); } private: @@ -120,40 +168,58 @@ // This is owned by the SearchPermissionsService which is owned by the // profile. TestSearchEngineDelegate* test_delegate_; + + base::test::ScopedFeatureList scoped_feature_list_; }; TEST_F(SearchPermissionsServiceTest, Initialization) { - test_delegate()->SetDSEOrigin(kGoogleURL); + for (ContentSettingsType type : {CONTENT_SETTINGS_TYPE_GEOLOCATION, + CONTENT_SETTINGS_TYPE_NOTIFICATIONS}) { + // DSE setting initialized to true if the content setting is ALLOW. + test_delegate()->SetDSEOrigin(kGoogleURL); + SetContentSetting(kGoogleURL, type, CONTENT_SETTING_ALLOW); + ReinitializeService(true /* clear_pref */); + EXPECT_EQ(CONTENT_SETTING_ALLOW, GetContentSetting(kGoogleURL, type)); + // Check that the correct value is restored when changing the DSE. + test_delegate()->SetDSEOrigin(kExampleURL); + EXPECT_EQ(CONTENT_SETTING_ALLOW, GetContentSetting(kGoogleURL, type)); - // DSE setting initialized to true if the content setting is ALLOW. - SetContentSetting(kGoogleURL, CONTENT_SETTING_ALLOW); + // DSE setting initialized to true if the content setting is ASK. + test_delegate()->SetDSEOrigin(kGoogleURL); + SetContentSetting(kGoogleURL, type, CONTENT_SETTING_DEFAULT); + EXPECT_EQ(CONTENT_SETTING_ASK, GetContentSetting(kGoogleURL, type)); + ReinitializeService(true /* clear_pref */); + EXPECT_EQ(CONTENT_SETTING_ALLOW, GetContentSetting(kGoogleURL, type)); + test_delegate()->SetDSEOrigin(kExampleURL); + EXPECT_EQ(CONTENT_SETTING_ASK, GetContentSetting(kGoogleURL, type)); + + // DSE setting initialized to false if the content setting is BLOCK. + test_delegate()->SetDSEOrigin(kGoogleURL); + SetContentSetting(kGoogleURL, type, CONTENT_SETTING_BLOCK); + ReinitializeService(true /* clear_pref */); + EXPECT_EQ(CONTENT_SETTING_BLOCK, GetContentSetting(kGoogleURL, type)); + test_delegate()->SetDSEOrigin(kExampleURL); + EXPECT_EQ(CONTENT_SETTING_BLOCK, GetContentSetting(kGoogleURL, type)); + + // Nothing happens if the pref is already set when the service is + // initialized. + test_delegate()->SetDSEOrigin(kGoogleURL); + SetContentSetting(kGoogleURL, type, CONTENT_SETTING_DEFAULT); + ReinitializeService(false /* clear_pref */); + EXPECT_EQ(CONTENT_SETTING_ASK, GetContentSetting(kGoogleURL, type)); + } + + // Check that the geolocation disclosure is reset. + SearchGeolocationDisclosureTabHelper::FakeShowingDisclosureForTests( + profile()); ReinitializeService(true /* clear_pref */); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL))); - EXPECT_TRUE(GetService()->GetDSEGeolocationSetting()); - - // DSE setting initialized to true if the content setting is ASK. - SetContentSetting(kGoogleURL, CONTENT_SETTING_ASK); - ReinitializeService(true /* clear_pref */); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL))); - EXPECT_TRUE(GetService()->GetDSEGeolocationSetting()); - - // DSE setting initialized to false if the content setting is BLOCK. - SetContentSetting(kGoogleURL, CONTENT_SETTING_BLOCK); - ReinitializeService(true /* clear_pref */); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL))); - EXPECT_FALSE(GetService()->GetDSEGeolocationSetting()); - - // Nothing happens if the pref is already set when the service is initialized. - SetContentSetting(kGoogleURL, CONTENT_SETTING_ASK); + EXPECT_TRUE(SearchGeolocationDisclosureTabHelper::IsDisclosureResetForTests( + profile())); + SearchGeolocationDisclosureTabHelper::FakeShowingDisclosureForTests( + profile()); ReinitializeService(false /* clear_pref */); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL))); - EXPECT_FALSE(GetService()->GetDSEGeolocationSetting()); - - // For non-Google search engine, the setting should also be used. - test_delegate()->SetDSEOrigin(kExampleURL); - SetContentSetting(kExampleURL, CONTENT_SETTING_ALLOW); - ReinitializeService(true /* clear_pref */); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kExampleURL))); + EXPECT_FALSE(SearchGeolocationDisclosureTabHelper::IsDisclosureResetForTests( + profile())); } TEST_F(SearchPermissionsServiceTest, OffTheRecord) { @@ -164,126 +230,146 @@ EXPECT_EQ(nullptr, service); } -TEST_F(SearchPermissionsServiceTest, UseDSEGeolocationSetting) { +TEST_F(SearchPermissionsServiceTest, Migration) { + // When location was previously allowed for the DSE, it should be carried + // over. + test_delegate()->SetDSEOrigin(kGoogleURL); + EXPECT_EQ(CONTENT_SETTING_ALLOW, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); + SetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_GEOLOCATION, + CONTENT_SETTING_DEFAULT); + EXPECT_EQ(CONTENT_SETTING_ASK, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_GEOLOCATION)); + SetOldPreference(true /* setting */); + ReinitializeService(true /* clear_pref */); + EXPECT_EQ(CONTENT_SETTING_ALLOW, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_GEOLOCATION)); + + // If location was previously blocked for the DSE, it should be carried over. + SetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_GEOLOCATION, + CONTENT_SETTING_DEFAULT); + SetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + CONTENT_SETTING_DEFAULT); + EXPECT_EQ(CONTENT_SETTING_ASK, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_GEOLOCATION)); + SetOldPreference(false /* setting */); + ReinitializeService(true /* clear_pref */); + EXPECT_EQ(CONTENT_SETTING_BLOCK, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_GEOLOCATION)); + // Notifications should be unaffected. + EXPECT_EQ(CONTENT_SETTING_ALLOW, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); + // Changing DSE should cause the setting to go back to ASK for Google. + test_delegate()->SetDSEOrigin(kExampleURL); + EXPECT_EQ(CONTENT_SETTING_ASK, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_GEOLOCATION)); + + // Check that migrating the pref causes it to be deleted. + SetOldPreference(false /* setting */); + ReinitializeService(true /* clear_pref */); + EXPECT_FALSE(profile()->GetPrefs()->HasPrefPath( + prefs::kDSEGeolocationSettingDeprecated)); + + // Check that the disclosure won't be reset if we migrate a pref. + SearchGeolocationDisclosureTabHelper::FakeShowingDisclosureForTests( + profile()); + SetOldPreference(false /* setting */); + ReinitializeService(true /* clear_pref */); + EXPECT_FALSE(SearchGeolocationDisclosureTabHelper::IsDisclosureResetForTests( + profile())); +} + +TEST_F(SearchPermissionsServiceTest, ArePermissionsControlledByDSE) { // True for origin that matches the CCTLD and meets all requirements. test_delegate()->SetDSEOrigin(kGoogleURL); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL))); + EXPECT_TRUE( + GetService()->ArePermissionsControlledByDSE(ToOrigin(kGoogleURL))); // False for different origin. - EXPECT_FALSE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleAusURL))); + EXPECT_FALSE( + GetService()->ArePermissionsControlledByDSE(ToOrigin(kGoogleAusURL))); // False for http origin. test_delegate()->SetDSEOrigin(kGoogleHTTPURL); EXPECT_FALSE( - GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleHTTPURL))); + GetService()->ArePermissionsControlledByDSE(ToOrigin(kGoogleHTTPURL))); - // False if the content setting is enterprise ask. - test_delegate()->SetDSEOrigin(kGoogleURL); - profile()->GetTestingPrefService()->SetManagedPref( - prefs::kManagedDefaultGeolocationSetting, - base::MakeUnique<base::Value>(CONTENT_SETTING_ASK)); - EXPECT_FALSE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL))); -} - -TEST_F(SearchPermissionsServiceTest, GetDSEGeolocationSetting) { - test_delegate()->SetDSEOrigin(kGoogleURL); - - // The case where the pref is set to true. - GetService()->SetDSEGeolocationSetting(true); - EXPECT_TRUE(GetService()->GetDSEGeolocationSetting()); - - // Make the content setting conflict. Check that it gets made consistent - // again. - SetContentSetting(kGoogleURL, CONTENT_SETTING_BLOCK); - EXPECT_FALSE(GetService()->GetDSEGeolocationSetting()); - - // The case where the pref is set to false. - SetContentSetting(kGoogleURL, CONTENT_SETTING_DEFAULT); - GetService()->SetDSEGeolocationSetting(false); - EXPECT_FALSE(GetService()->GetDSEGeolocationSetting()); - - // Make the content setting conflict. Check that it gets made consistent - // again. - SetContentSetting(kGoogleURL, CONTENT_SETTING_ALLOW); - EXPECT_TRUE(GetService()->GetDSEGeolocationSetting()); -} - -TEST_F(SearchPermissionsServiceTest, SetDSEGeolocationSetting) { - test_delegate()->SetDSEOrigin(kGoogleURL); - - GetService()->SetDSEGeolocationSetting(true); - EXPECT_TRUE(GetService()->GetDSEGeolocationSetting()); - - GetService()->SetDSEGeolocationSetting(false); - EXPECT_FALSE(GetService()->GetDSEGeolocationSetting()); - - // Check that the content setting is always reset when setting the DSE - // setting. - SetContentSetting(kGoogleURL, CONTENT_SETTING_ALLOW); - GetService()->SetDSEGeolocationSetting(true); - EXPECT_EQ(CONTENT_SETTING_ASK, GetContentSetting(kGoogleURL)); - - SetContentSetting(kGoogleURL, CONTENT_SETTING_BLOCK); - GetService()->SetDSEGeolocationSetting(false); - EXPECT_EQ(CONTENT_SETTING_ASK, GetContentSetting(kGoogleURL)); - - // Check that the pref doesn't change if it's not user settable. - GetService()->SetDSEGeolocationSetting(true); - profile()->GetTestingPrefService()->SetManagedPref( - prefs::kManagedDefaultGeolocationSetting, - base::MakeUnique<base::Value>(CONTENT_SETTING_ASK)); - EXPECT_TRUE(GetService()->GetDSEGeolocationSetting()); - GetService()->SetDSEGeolocationSetting(false); - EXPECT_TRUE(GetService()->GetDSEGeolocationSetting()); + // True even for non-Google search engines. + test_delegate()->SetDSEOrigin(kExampleURL); + EXPECT_TRUE( + GetService()->ArePermissionsControlledByDSE(ToOrigin(kExampleURL))); } TEST_F(SearchPermissionsServiceTest, DSEChanges) { test_delegate()->SetDSEOrigin(kGoogleURL); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL))); - EXPECT_TRUE(GetService()->GetDSEGeolocationSetting()); + EXPECT_EQ(CONTENT_SETTING_ALLOW, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_GEOLOCATION)); + EXPECT_EQ(CONTENT_SETTING_ALLOW, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); - // Change to google.com.au, setting should remain the same. + // Change to google.com.au. Settings for google.com should revert and settings + // for google.com.au should be set to allow. test_delegate()->SetDSEOrigin(kGoogleAusURL); - EXPECT_FALSE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL))); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleAusURL))); - EXPECT_TRUE(GetService()->GetDSEGeolocationSetting()); + EXPECT_EQ(CONTENT_SETTING_ASK, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_GEOLOCATION)); + EXPECT_EQ(CONTENT_SETTING_ASK, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); + EXPECT_EQ( + CONTENT_SETTING_ALLOW, + GetContentSetting(kGoogleAusURL, CONTENT_SETTINGS_TYPE_GEOLOCATION)); + EXPECT_EQ( + CONTENT_SETTING_ALLOW, + GetContentSetting(kGoogleAusURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); - // Set the content setting for google.com to block. When we change back to - // google.com, the setting should be set to false. - SetContentSetting(kGoogleURL, CONTENT_SETTING_BLOCK); + // Set the content setting for google.com to block for notifications. When we + // change back to google.com, the setting should still be blocked. + SetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + CONTENT_SETTING_BLOCK); test_delegate()->SetDSEOrigin(kGoogleURL); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL))); - EXPECT_FALSE(GetService()->GetDSEGeolocationSetting()); + EXPECT_EQ(CONTENT_SETTING_BLOCK, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); + EXPECT_EQ( + CONTENT_SETTING_ASK, + GetContentSetting(kGoogleAusURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); - // Now set the content setting for google.com.au to ALLOW. When we change to - // google.com.au, its content setting should be reset and the setting should - // still be false. - SetContentSetting(kGoogleAusURL, CONTENT_SETTING_ALLOW); + // Now set the notification setting for google.com.au to ALLOW. When we change + // to google.com.au notifications should still be blocked. The google.com + // notifications setting should remain blocked. + SetContentSetting(kGoogleAusURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + CONTENT_SETTING_ALLOW); test_delegate()->SetDSEOrigin(kGoogleAusURL); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleAusURL))); - EXPECT_FALSE(GetService()->GetDSEGeolocationSetting()); - EXPECT_EQ(CONTENT_SETTING_ASK, GetContentSetting(kGoogleAusURL)); + EXPECT_EQ(CONTENT_SETTING_BLOCK, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); + EXPECT_EQ( + CONTENT_SETTING_BLOCK, + GetContentSetting(kGoogleAusURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); - // Now set to a non-google search. The setting should still be used, but only - // for the non-google search. - test_delegate()->SetDSEOrigin(kExampleURL); - EXPECT_FALSE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleAusURL))); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kExampleURL))); + // Now changing back to google.com, the google.com.au notifications setting + // should be reset to ask (we reset it because of the conflict previously). + test_delegate()->SetDSEOrigin(kGoogleURL); + EXPECT_EQ(CONTENT_SETTING_BLOCK, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); + EXPECT_EQ( + CONTENT_SETTING_ASK, + GetContentSetting(kGoogleAusURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); - // Go back to google.com.au. The setting should still be false because that's - // what it last was. + // The google.com setting was block before it became the DSE and it remains + // block. Now, if it's toggled to allow while it's still the DSE, we should + // reset it back to ask once it is no longer the DSE. + SetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, + CONTENT_SETTING_ALLOW); test_delegate()->SetDSEOrigin(kGoogleAusURL); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleAusURL))); - EXPECT_FALSE(GetService()->GetDSEGeolocationSetting()); + EXPECT_EQ(CONTENT_SETTING_ASK, + GetContentSetting(kGoogleURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); + EXPECT_EQ( + CONTENT_SETTING_ALLOW, + GetContentSetting(kGoogleAusURL, CONTENT_SETTINGS_TYPE_NOTIFICATIONS)); } TEST_F(SearchPermissionsServiceTest, DSEChangesAndDisclosure) { test_delegate()->SetDSEOrigin(kGoogleURL); SearchGeolocationDisclosureTabHelper::FakeShowingDisclosureForTests( profile()); - EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL))); - EXPECT_TRUE(GetService()->GetDSEGeolocationSetting()); - // Change to google.com.au. The disclosure should not be reset. test_delegate()->SetDSEOrigin(kGoogleAusURL); EXPECT_FALSE(SearchGeolocationDisclosureTabHelper::IsDisclosureResetForTests(
diff --git a/chrome/browser/geolocation/geolocation_permission_context_android.cc b/chrome/browser/geolocation/geolocation_permission_context_android.cc index 3d07d3f..8cdea9d 100644 --- a/chrome/browser/geolocation/geolocation_permission_context_android.cc +++ b/chrome/browser/geolocation/geolocation_permission_context_android.cc
@@ -13,7 +13,6 @@ #include "chrome/browser/android/location_settings.h" #include "chrome/browser/android/location_settings_impl.h" #include "chrome/browser/android/search_permissions/search_geolocation_disclosure_tab_helper.h" -#include "chrome/browser/android/search_permissions/search_permissions_service.h" #include "chrome/browser/android/tab_android.h" #include "chrome/browser/permissions/permission_request_id.h" #include "chrome/browser/permissions/permission_uma_util.h" @@ -96,45 +95,6 @@ GeolocationPermissionContextAndroid::~GeolocationPermissionContextAndroid() { } -ContentSetting GeolocationPermissionContextAndroid::GetPermissionStatusInternal( - content::RenderFrameHost* render_frame_host, - const GURL& requesting_origin, - const GURL& embedding_origin) const { - ContentSetting value = - GeolocationPermissionContext::GetPermissionStatusInternal( - render_frame_host, requesting_origin, embedding_origin); - - if (value == CONTENT_SETTING_ASK && requesting_origin == embedding_origin) { - // Consult the DSE Geolocation setting. Note that this only needs to be - // consulted when the content setting is ASK. In the other cases (ALLOW or - // BLOCK) checking the setting is redundant, as the setting is kept - // consistent with the content setting. - SearchPermissionsService* search_helper = - SearchPermissionsService::Factory::GetForBrowserContext(profile()); - - // If the user is incognito, use the DSE Geolocation setting from the - // original profile - but only if it is BLOCK. - if (!search_helper) { - DCHECK(profile()->IsOffTheRecord()); - search_helper = SearchPermissionsService::Factory::GetForBrowserContext( - profile()->GetOriginalProfile()); - } - - if (search_helper && search_helper->UseDSEGeolocationSetting( - url::Origin::Create(embedding_origin))) { - if (!search_helper->GetDSEGeolocationSetting()) { - // If the DSE setting is off, always return BLOCK. - value = CONTENT_SETTING_BLOCK; - } else if (!profile()->IsOffTheRecord()) { - // Otherwise, return ALLOW only if this is not incognito. - value = CONTENT_SETTING_ALLOW; - } - } - } - - return value; -} - // static void GeolocationPermissionContextAndroid::AddDayOffsetForTesting(int days) { g_day_offset_for_testing += days;
diff --git a/chrome/browser/geolocation/geolocation_permission_context_android.h b/chrome/browser/geolocation/geolocation_permission_context_android.h index 563eef1..59eab8c 100644 --- a/chrome/browser/geolocation/geolocation_permission_context_android.h +++ b/chrome/browser/geolocation/geolocation_permission_context_android.h
@@ -60,13 +60,6 @@ explicit GeolocationPermissionContextAndroid(Profile* profile); ~GeolocationPermissionContextAndroid() override; - protected: - // GeolocationPermissionContext: - ContentSetting GetPermissionStatusInternal( - content::RenderFrameHost* render_frame_host, - const GURL& requesting_origin, - const GURL& embedding_origin) const override; - private: friend class GeolocationPermissionContextTests; friend class PermissionManagerTest;
diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc index 6715df5..94e4ed5 100644 --- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc +++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
@@ -81,9 +81,16 @@ return url::Origin::Create(GURL(kDSETestUrl)); } - void SetDSEChangedCallback(const base::Closure& callback) override {} + void SetDSEChangedCallback(const base::Closure& callback) override { + dse_changed_callback_ = callback; + } + + void UpdateDSEOrigin() { dse_changed_callback_.Run(); } static const char kDSETestUrl[]; + + private: + base::Closure dse_changed_callback_; }; const char TestSearchEngineDelegate::kDSETestUrl[] = "https://www.dsetest.com"; @@ -1110,26 +1117,26 @@ #if defined(OS_ANDROID) TEST_F(GeolocationPermissionContextTests, SearchGeolocationInIncognito) { GURL requesting_frame(TestSearchEngineDelegate::kDSETestUrl); - // The DSE Geolocation setting should be used in incognito if it is BLOCK, - // but not if it is ALLOW. - SearchPermissionsService* geo_service = + + SearchPermissionsService* service = SearchPermissionsService::Factory::GetForBrowserContext(profile()); - geo_service->SetSearchEngineDelegateForTest( - base::MakeUnique<TestSearchEngineDelegate>()); + std::unique_ptr<TestSearchEngineDelegate> delegate = + base::MakeUnique<TestSearchEngineDelegate>(); + TestSearchEngineDelegate* delegate_ptr = delegate.get(); + service->SetSearchEngineDelegateForTest(std::move(delegate)); + delegate_ptr->UpdateDSEOrigin(); - Profile* otr_profile = profile()->GetOffTheRecordProfile(); - - // A DSE setting of ALLOW should not flow through to incognito. - geo_service->SetDSEGeolocationSetting(true); - ASSERT_EQ(CONTENT_SETTING_ASK, - PermissionManager::Get(otr_profile) + // The DSE should be auto-granted geolocation. + ASSERT_EQ(CONTENT_SETTING_ALLOW, + PermissionManager::Get(profile()) ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_GEOLOCATION, requesting_frame, requesting_frame) .content_setting); - // Changing the setting to BLOCK should flow through to incognito. - geo_service->SetDSEGeolocationSetting(false); - ASSERT_EQ(CONTENT_SETTING_BLOCK, + Profile* otr_profile = profile()->GetOffTheRecordProfile(); + + // A DSE setting of ALLOW should not flow through to incognito. + ASSERT_EQ(CONTENT_SETTING_ASK, PermissionManager::Get(otr_profile) ->GetPermissionStatus(CONTENT_SETTINGS_TYPE_GEOLOCATION, requesting_frame, requesting_frame)
diff --git a/chrome/browser/ui/android/page_info/page_info_popup_android.cc b/chrome/browser/ui/android/page_info/page_info_popup_android.cc index eedd487..2fb7e47 100644 --- a/chrome/browser/ui/android/page_info/page_info_popup_android.cc +++ b/chrome/browser/ui/android/page_info/page_info_popup_android.cc
@@ -8,7 +8,6 @@ #include "base/android/jni_array.h" #include "base/android/jni_string.h" #include "base/stl_util.h" -#include "chrome/browser/android/search_permissions/search_permissions_service.h" #include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ssl/security_state_tab_helper.h" @@ -44,8 +43,7 @@ PageInfoPopupAndroid::PageInfoPopupAndroid(JNIEnv* env, jobject java_page_info_pop, - content::WebContents* web_contents) - : search_geolocation_service_(nullptr) { + content::WebContents* web_contents) { // Important to use GetVisibleEntry to match what's showing in the omnibox. content::NavigationEntry* nav_entry = web_contents->GetController().GetVisibleEntry(); @@ -63,10 +61,6 @@ security_state::SecurityInfo security_info; helper->GetSecurityInfo(&security_info); - search_geolocation_service_ = - SearchPermissionsService::Factory::GetForBrowserContext( - web_contents->GetBrowserContext()); - presenter_.reset(new PageInfo( this, Profile::FromBrowserContext(web_contents->GetBrowserContext()), TabSpecificContentSettings::FromWebContents(web_contents), web_contents, @@ -172,15 +166,7 @@ // Handle exceptions for permissions which need to be displayed even if they // are set to the default. - if (permission.type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { - if (search_geolocation_service_ && - search_geolocation_service_->UseDSEGeolocationSetting( - url::Origin::Create(url_))) { - return search_geolocation_service_->GetDSEGeolocationSetting() - ? CONTENT_SETTING_ALLOW - : CONTENT_SETTING_BLOCK; - } - } else if (permission.type == CONTENT_SETTINGS_TYPE_ADS) { + if (permission.type == CONTENT_SETTINGS_TYPE_ADS) { // The subresource filter permission should always display the default // setting if it is showing up in Page Info. Logic for whether the // setting should show up in Page Info is in ShouldShowPermission in
diff --git a/chrome/browser/ui/android/page_info/page_info_popup_android.h b/chrome/browser/ui/android/page_info/page_info_popup_android.h index 7bdc61b..7cf4f9d3 100644 --- a/chrome/browser/ui/android/page_info/page_info_popup_android.h +++ b/chrome/browser/ui/android/page_info/page_info_popup_android.h
@@ -18,8 +18,6 @@ class WebContents; } -class SearchPermissionsService; - // A Java counterpart will be generated for this enum. // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser enum PageInfoConnectionType { @@ -63,9 +61,6 @@ // The java prompt implementation. base::android::ScopedJavaGlobalRef<jobject> popup_jobject_; - // Owned by the profile. - SearchPermissionsService* search_geolocation_service_; - GURL url_; content::WebContents* web_contents_;
diff --git a/chrome/browser/ui/apps/app_info_dialog.h b/chrome/browser/ui/apps/app_info_dialog.h index 698e8982..4710b73 100644 --- a/chrome/browser/ui/apps/app_info_dialog.h +++ b/chrome/browser/ui/apps/app_info_dialog.h
@@ -51,4 +51,7 @@ const extensions::Extension* app, const base::Closure& close_callback); +// Gets the callback to run after a dialog is created. Only used in tests. +base::OnceClosure& GetAppInfoDialogCreatedCallbackForTesting(); + #endif // CHROME_BROWSER_UI_APPS_APP_INFO_DIALOG_H_
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc index 3ba058d..1e66a34c 100644 --- a/chrome/browser/ui/browser_command_controller.cc +++ b/chrome/browser/ui/browser_command_controller.cc
@@ -28,6 +28,7 @@ #include "chrome/browser/shell_integration.h" #include "chrome/browser/signin/signin_promo.h" #include "chrome/browser/sync/profile_sync_service_factory.h" +#include "chrome/browser/ui/apps/app_info_dialog.h" #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_commands.h" @@ -657,6 +658,11 @@ browser_, browser_->tab_strip_model()->GetActiveWebContents()->GetVisibleURL()); break; + case IDC_APP_INFO: + ShowAppInfoInNativeDialog( + browser_->tab_strip_model()->GetActiveWebContents(), profile(), + browser_->hosted_app_controller()->GetExtension(), base::Closure()); + break; default: LOG(WARNING) << "Received Unimplemented Command: " << id; @@ -841,6 +847,8 @@ is_experimental_hosted_app); command_updater_.UpdateCommandEnabled(IDC_SITE_SETTINGS, is_experimental_hosted_app); + command_updater_.UpdateCommandEnabled(IDC_APP_INFO, + is_experimental_hosted_app); // Window management commands command_updater_.UpdateCommandEnabled(IDC_SELECT_NEXT_TAB, normal_window);
diff --git a/chrome/browser/ui/extensions/hosted_app_browser_controller.h b/chrome/browser/ui/extensions/hosted_app_browser_controller.h index b2823cfc..65ba7429 100644 --- a/chrome/browser/ui/extensions/hosted_app_browser_controller.h +++ b/chrome/browser/ui/extensions/hosted_app_browser_controller.h
@@ -60,10 +60,10 @@ // Gets the domain and registry of the app start url (e.g example.com.au). std::string GetDomainAndRegistry() const; - private: // Gets the extension for this controller. const Extension* GetExtension() const; + private: Browser* const browser_; const std::string extension_id_;
diff --git a/chrome/browser/ui/extensions/hosted_app_browsertest.cc b/chrome/browser/ui/extensions/hosted_app_browsertest.cc index 2d54cc7..8a7a629 100644 --- a/chrome/browser/ui/extensions/hosted_app_browsertest.cc +++ b/chrome/browser/ui/extensions/hosted_app_browsertest.cc
@@ -17,6 +17,7 @@ #include "chrome/browser/extensions/extension_util.h" #include "chrome/browser/extensions/test_extension_dir.h" #include "chrome/browser/renderer_context_menu/render_view_context_menu_test_util.h" +#include "chrome/browser/ui/apps/app_info_dialog.h" #include "chrome/browser/ui/browser_commands.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_list.h" @@ -445,6 +446,27 @@ ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); } +// Check the 'App info' menu button for Hosted App windows. +IN_PROC_BROWSER_TEST_P(HostedAppPWAOnlyTest, AppInfo) { + WebApplicationInfo web_app_info; + web_app_info.app_url = GURL(kExampleURL); + const extensions::Extension* app = InstallBookmarkApp(web_app_info); + Browser* app_browser = LaunchAppBrowser(app); + + bool dialog_created = false; + + GetAppInfoDialogCreatedCallbackForTesting() = base::BindOnce( + [](bool* dialog_created) { *dialog_created = true; }, &dialog_created); + + chrome::ExecuteCommand(app_browser, IDC_APP_INFO); + + EXPECT_TRUE(dialog_created); + + // The test closure should have run. But clear the global in case it hasn't. + EXPECT_FALSE(GetAppInfoDialogCreatedCallbackForTesting()); + GetAppInfoDialogCreatedCallbackForTesting().Reset(); +} + // Common app manifest for HostedAppProcessModelTests. constexpr const char kHostedAppProcessModelManifest[] = R"( { "name": "Hosted App Process Model Test",
diff --git a/chrome/browser/ui/extensions/hosted_app_menu_model.cc b/chrome/browser/ui/extensions/hosted_app_menu_model.cc index bf26c02..1b6026c 100644 --- a/chrome/browser/ui/extensions/hosted_app_menu_model.cc +++ b/chrome/browser/ui/extensions/hosted_app_menu_model.cc
@@ -29,4 +29,5 @@ AddItemWithStringId(IDC_ROUTE_MEDIA, IDS_MEDIA_ROUTER_MENU_ITEM_TITLE); CreateCutCopyPasteMenu(); AddItemWithStringId(IDC_SITE_SETTINGS, IDS_SITE_SETTINGS); + AddItemWithStringId(IDC_APP_INFO, IDS_APP_CONTEXT_MENU_SHOW_INFO); }
diff --git a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc index 8e90d86..69aedfb 100644 --- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc +++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_views.cc
@@ -11,6 +11,7 @@ #include "build/build_config.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/ui/apps/app_info_dialog.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_dialog_container.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_footer_panel.h" #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_header_panel.h" @@ -104,6 +105,13 @@ constrained_window::CreateBrowserModalDialogViews(dialog, window); dialog_widget->Show(); } + if (GetAppInfoDialogCreatedCallbackForTesting()) + std::move(GetAppInfoDialogCreatedCallbackForTesting()).Run(); +} + +base::OnceClosure& GetAppInfoDialogCreatedCallbackForTesting() { + CR_DEFINE_STATIC_LOCAL(base::OnceClosure, closure, ()); + return closure; } AppInfoDialog::AppInfoDialog(gfx::NativeWindow parent_window,
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc index 984b4d49..3b10adaf 100644 --- a/chrome/common/chrome_features.cc +++ b/chrome/common/chrome_features.cc
@@ -252,6 +252,11 @@ base::FEATURE_DISABLED_BY_DEFAULT}; #endif +#if defined(OS_ANDROID) +const base::Feature kGrantNotificationsToDSE{"GrantNotificationsToDSE", + base::FEATURE_ENABLED_BY_DEFAULT}; +#endif // defined(OS_ANDROID) + #if defined (OS_CHROMEOS) // Enables or disables the Happiness Tracking System for the device. const base::Feature kHappinessTrackingSystem {
diff --git a/chrome/common/chrome_features.h b/chrome/common/chrome_features.h index 8bab90e..891d564 100644 --- a/chrome/common/chrome_features.h +++ b/chrome/common/chrome_features.h
@@ -134,6 +134,10 @@ extern const base::Feature kGdiTextPrinting; #endif +#if defined(OS_ANDROID) +extern const base::Feature kGrantNotificationsToDSE; +#endif + #if defined(OS_CHROMEOS) extern const base::Feature kHappinessTrackingSystem; #endif
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index 50a0a4c..3393f5d 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc
@@ -2342,8 +2342,13 @@ #endif // A dictionary which stores whether location access is enabled for the current -// default search engine. -const char kDSEGeolocationSetting[] = "dse_geolocation_setting"; +// default search engine. Deprecated for kDSEPermissionsSetting. +const char kDSEGeolocationSettingDeprecated[] = "dse_geolocation_setting"; + +// A dictionary which stores the geolocation and notifications content settings +// for the default search engine before it became the default search engine so +// that they can be restored if the DSE is ever changed. +const char kDSEPermissionsSettings[] = "dse_permissions_settings"; // A dictionary of manifest URLs of Web Share Targets to a dictionary containing // attributes of its share_target field found in its manifest. Each key in the
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 1d811037..f3ec645c 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h
@@ -839,7 +839,9 @@ extern const char kSearchGeolocationPostDisclosureMetricsRecorded[]; #endif -extern const char kDSEGeolocationSetting[]; +extern const char kDSEGeolocationSettingDeprecated[]; + +extern const char kDSEPermissionsSettings[]; extern const char kWebShareVisitedTargets[];
diff --git a/components/arc/ime/arc_ime_service.cc b/components/arc/ime/arc_ime_service.cc index bfbc332..a1cb812a 100644 --- a/components/arc/ime/arc_ime_service.cc +++ b/components/arc/ime/arc_ime_service.cc
@@ -289,8 +289,6 @@ ime_bridge_->SendOnKeyboardBoundsChanging(bounds_in_px); } -void ArcImeService::OnKeyboardClosed() {} - //////////////////////////////////////////////////////////////////////////////// // Overridden from ui::TextInputClient:
diff --git a/components/arc/ime/arc_ime_service.h b/components/arc/ime/arc_ime_service.h index a09b3ca..39a81c9 100644 --- a/components/arc/ime/arc_ime_service.h +++ b/components/arc/ime/arc_ime_service.h
@@ -96,7 +96,6 @@ // Overridden from keyboard::KeyboardControllerObserver. void OnKeyboardBoundsChanging(const gfx::Rect& rect) override; - void OnKeyboardClosed() override; // Overridden from ui::TextInputClient: void SetCompositionText(const ui::CompositionText& composition) override;
diff --git a/content/browser/accessibility/dump_accessibility_events_browsertest.cc b/content/browser/accessibility/dump_accessibility_events_browsertest.cc index 5c24a18..a4dad94 100644 --- a/content/browser/accessibility/dump_accessibility_events_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_events_browsertest.cc
@@ -177,8 +177,9 @@ RunEventTest(FILE_PATH_LITERAL("aria-treeitem-focus.html")); } +// http:/crbug.com/791268 IN_PROC_BROWSER_TEST_F(DumpAccessibilityEventsTest, - AccessibilityEventsAriaComboBoxFocus) { + DISABLED_AccessibilityEventsAriaComboBoxFocus) { RunEventTest(FILE_PATH_LITERAL("aria-combo-box-focus.html")); }
diff --git a/ios/chrome/browser/ui/reading_list/BUILD.gn b/ios/chrome/browser/ui/reading_list/BUILD.gn index 94b52a18..1bc1c02 100644 --- a/ios/chrome/browser/ui/reading_list/BUILD.gn +++ b/ios/chrome/browser/ui/reading_list/BUILD.gn
@@ -70,6 +70,8 @@ "reading_list_empty_collection_background.mm", "reading_list_toolbar.h", "reading_list_toolbar.mm", + "reading_list_toolbar_button.h", + "reading_list_toolbar_button.mm", "reading_list_view_controller.h", "reading_list_view_controller.mm", "text_badge_view.h",
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm b/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm index 1727942..5e4f55c 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller.mm
@@ -205,6 +205,11 @@ [self.collectionView addGestureRecognizer:longPressRecognizer]; } +- (void)viewDidLayoutSubviews { + [super viewDidLayoutSubviews]; + [_toolbar updateHeight]; +} + #pragma mark - UICollectionViewDelegate - (void)collectionView:(UICollectionView*)collectionView
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_toolbar.h b/ios/chrome/browser/ui/reading_list/reading_list_toolbar.h index 0b761102..a80f7f5f 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_toolbar.h +++ b/ios/chrome/browser/ui/reading_list/reading_list_toolbar.h
@@ -52,6 +52,8 @@ // message and no title. - (ActionSheetCoordinator*)actionSheetForMarkWithBaseViewController: (UIViewController*)viewController; +// Updates the height of the toolbar. +- (void)updateHeight; @end
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_toolbar.mm b/ios/chrome/browser/ui/reading_list/reading_list_toolbar.mm index 8b3ff0f..1a6e17d 100644 --- a/ios/chrome/browser/ui/reading_list/reading_list_toolbar.mm +++ b/ios/chrome/browser/ui/reading_list/reading_list_toolbar.mm
@@ -4,61 +4,55 @@ #import "ios/chrome/browser/ui/reading_list/reading_list_toolbar.h" -#include "base/logging.h" #import "ios/chrome/browser/ui/alert_coordinator/action_sheet_coordinator.h" -#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" -#include "ios/chrome/browser/ui/rtl_geometry.h" +#import "ios/chrome/browser/ui/reading_list/reading_list_toolbar_button.h" #import "ios/chrome/browser/ui/util/constraints_ui_util.h" #include "ios/chrome/grit/ios_strings.h" #import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" #include "ui/base/l10n/l10n_util_mac.h" -#import "ui/gfx/ios/NSString+CrStringDrawing.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif namespace { -// Height of the toolbar in normal state. -const int kToolbarNormalHeight = 48; -// Height of the expanded toolbar (buttons on multiple lines). -const int kToolbarExpandedHeight = 58; - +const CGFloat kToolbarNormalHeight = 48.0f; +// Height of the toolbar when button labels has word-wrap up to 2 lines. +const CGFloat kToolbarTwoLinesHeight = 58.0f; +// Height of the toolbar when button labels has word-wrap up to 3 lines. +const CGFloat kToolbarThreeLinesHeight = 68.0f; // Shadow opacity. -const CGFloat kShadowOpacity = 0.2f; +const CGFloat kShadowOpacity = 0.12f; +// Shadow radius. +const CGFloat kShadowRadius = 12.0f; // Horizontal margin for the stack view content. -const CGFloat kHorizontalMargin = 8.0f; -// Horizontal spacing between the elements of the stack view. +const CGFloat kHorizontalMargin = 16.0f; +// Vertical margin for the stack view content. +const CGFloat kVerticalMargin = 8.0f; +// Horizontal spacing between the buttons of the stack view. This is used for +// calculating the maximum width of buttons but NOT used directly to set +// stackView.spacing. const CGFloat kHorizontalSpacing = 8.0f; -typedef NS_ENUM(NSInteger, ButtonPositioning) { Leading, Centered, Trailing }; - } // namespace @interface ReadingListToolbar () -// Container for the edit button, preventing it to have the same width as the -// stack view. -@property(nonatomic, strong) UIView* editButtonContainer; +// Button that displays "Edit". +@property(nonatomic, strong) ReadingListToolbarButton* editButton; // Button that displays "Delete". -@property(nonatomic, strong) UIButton* deleteButton; -@property(nonatomic, strong) UIView* deleteButtonContainer; +@property(nonatomic, strong) ReadingListToolbarButton* deleteButton; // Button that displays "Delete All Read". -@property(nonatomic, strong) UIButton* deleteAllButton; -@property(nonatomic, strong) UIView* deleteAllButtonContainer; +@property(nonatomic, strong) ReadingListToolbarButton* deleteAllButton; // Button that displays "Cancel". -@property(nonatomic, strong) UIButton* cancelButton; -@property(nonatomic, strong) UIView* cancelButtonContainer; +@property(nonatomic, strong) ReadingListToolbarButton* cancelButton; // Button that displays the mark options. -@property(nonatomic, strong) UIButton* markButton; -@property(nonatomic, strong) UIView* markButtonContainer; +@property(nonatomic, strong) ReadingListToolbarButton* markButton; // Stack view for arranging the buttons. @property(nonatomic, strong) UIStackView* stackView; // Height constraint for the stack view containing the buttons. @property(nonatomic, strong) NSLayoutConstraint* heightConstraint; -// Creates a button with a |title| and a style according to |destructive|. -- (UIButton*)buttonWithText:(NSString*)title destructive:(BOOL)isDestructive; // Set the mark button label to |text|. - (void)setMarkButtonText:(NSString*)text; // Updates the button labels to match an empty selection. @@ -75,99 +69,48 @@ @implementation ReadingListToolbar -@synthesize editButtonContainer = _editButtonContainer; +@synthesize editButton = _editButton; @synthesize deleteButton = _deleteButton; -@synthesize deleteButtonContainer = _deleteButtonContainer; @synthesize deleteAllButton = _deleteAllButton; -@synthesize deleteAllButtonContainer = _deleteAllButtonContainer; @synthesize cancelButton = _cancelButton; -@synthesize cancelButtonContainer = _cancelButtonContainer; -@synthesize stackView = _stackView; @synthesize markButton = _markButton; -@synthesize markButtonContainer = _markButtonContainer; +@synthesize stackView = _stackView; @synthesize state = _state; @synthesize heightConstraint = _heightConstraint; - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { - NSDictionary* views = nil; - NSArray* constraints = nil; + _deleteButton = [[ReadingListToolbarButton alloc] + initWithText:l10n_util::GetNSString(IDS_IOS_READING_LIST_DELETE_BUTTON) + destructive:YES + position:Leading]; - _deleteButton = [self buttonWithText:l10n_util::GetNSString( - IDS_IOS_READING_LIST_DELETE_BUTTON) - destructive:YES]; - _deleteButton.translatesAutoresizingMaskIntoConstraints = NO; - _deleteButtonContainer = [[UIView alloc] init]; - [_deleteButtonContainer addSubview:_deleteButton]; - views = @{ @"button" : _deleteButton }; - constraints = @[ @"V:|[button]|", @"H:|[button]" ]; - ApplyVisualConstraints(constraints, views); - [_deleteButton.trailingAnchor - constraintLessThanOrEqualToAnchor:_deleteButtonContainer.trailingAnchor] - .active = YES; + _deleteAllButton = [[ReadingListToolbarButton alloc] + initWithText:l10n_util::GetNSString( + IDS_IOS_READING_LIST_DELETE_ALL_READ_BUTTON) + destructive:YES + position:Leading]; - _deleteAllButton = - [self buttonWithText:l10n_util::GetNSString( - IDS_IOS_READING_LIST_DELETE_ALL_READ_BUTTON) - destructive:YES]; - _deleteAllButton.translatesAutoresizingMaskIntoConstraints = NO; - _deleteAllButtonContainer = [[UIView alloc] init]; - [_deleteAllButtonContainer addSubview:_deleteAllButton]; - views = @{ @"button" : _deleteAllButton }; - constraints = @[ @"V:|[button]|", @"H:|[button]" ]; - ApplyVisualConstraints(constraints, views); - [_deleteAllButton.trailingAnchor - constraintLessThanOrEqualToAnchor:_deleteAllButtonContainer - .trailingAnchor] - .active = YES; + _markButton = [[ReadingListToolbarButton alloc] + initWithText:l10n_util::GetNSString( + IDS_IOS_READING_LIST_MARK_ALL_BUTTON) + destructive:NO + position:Centered]; - _markButton = [self buttonWithText:l10n_util::GetNSString( - IDS_IOS_READING_LIST_MARK_ALL_BUTTON) - destructive:NO]; - _markButton.translatesAutoresizingMaskIntoConstraints = NO; - _markButtonContainer = [[UIView alloc] init]; - [_markButtonContainer addSubview:_markButton]; - views = @{ @"button" : _markButton }; - constraints = @[ @"V:|[button]|" ]; - ApplyVisualConstraints(constraints, views); - [_markButton.centerXAnchor - constraintEqualToAnchor:_markButtonContainer.centerXAnchor] - .active = YES; - [_markButton.trailingAnchor - constraintLessThanOrEqualToAnchor:_markButtonContainer.trailingAnchor] - .active = YES; - [_markButton.leadingAnchor - constraintGreaterThanOrEqualToAnchor:_markButtonContainer.leadingAnchor] - .active = YES; + _cancelButton = [[ReadingListToolbarButton alloc] + initWithText:l10n_util::GetNSString(IDS_IOS_READING_LIST_CANCEL_BUTTON) + destructive:NO + position:Trailing]; - _cancelButton = [self buttonWithText:l10n_util::GetNSString( - IDS_IOS_READING_LIST_CANCEL_BUTTON) - destructive:NO]; - _cancelButton.translatesAutoresizingMaskIntoConstraints = NO; - _cancelButtonContainer = [[UIView alloc] init]; - [_cancelButtonContainer addSubview:_cancelButton]; - views = @{ @"button" : _cancelButton }; - constraints = @[ @"V:|[button]|", @"H:[button]|" ]; - ApplyVisualConstraints(constraints, views); - [_cancelButton.leadingAnchor - constraintGreaterThanOrEqualToAnchor:_cancelButtonContainer - .leadingAnchor] - .active = YES; + _editButton = [[ReadingListToolbarButton alloc] + initWithText:l10n_util::GetNSString(IDS_IOS_READING_LIST_EDIT_BUTTON) + destructive:NO + position:Trailing]; - UIButton* editButton = [self - buttonWithText:l10n_util::GetNSString(IDS_IOS_READING_LIST_EDIT_BUTTON) - destructive:NO]; - editButton.translatesAutoresizingMaskIntoConstraints = NO; - _editButtonContainer = [[UIView alloc] initWithFrame:CGRectZero]; - [_editButtonContainer addSubview:editButton]; - views = @{ @"button" : editButton }; - constraints = @[ @"V:|[button]|", @"H:[button]|" ]; - ApplyVisualConstraints(constraints, views); - - [editButton addTarget:nil - action:@selector(enterEditingModePressed) - forControlEvents:UIControlEventTouchUpInside]; + [_editButton addTarget:nil + action:@selector(enterEditingModePressed) + forControlEvents:UIControlEventTouchUpInside]; [_deleteButton addTarget:nil action:@selector(deletePressed) @@ -186,13 +129,11 @@ forControlEvents:UIControlEventTouchUpInside]; _stackView = [[UIStackView alloc] initWithArrangedSubviews:@[ - _editButtonContainer, _deleteButtonContainer, _deleteAllButtonContainer, - _markButtonContainer, _cancelButtonContainer + _editButton, _deleteButton, _deleteAllButton, _markButton, _cancelButton ]]; _stackView.axis = UILayoutConstraintAxisHorizontal; _stackView.alignment = UIStackViewAlignmentFill; _stackView.distribution = UIStackViewDistributionFillEqually; - _stackView.spacing = kHorizontalSpacing; [self addSubview:_stackView]; _stackView.translatesAutoresizingMaskIntoConstraints = NO; @@ -202,12 +143,13 @@ constraintEqualToConstant:kToolbarNormalHeight]; _heightConstraint.active = YES; - _stackView.layoutMargins = - UIEdgeInsetsMake(0, kHorizontalMargin, 0, kHorizontalMargin); + _stackView.layoutMargins = UIEdgeInsetsMake( + kVerticalMargin, kHorizontalMargin, kVerticalMargin, kHorizontalMargin); _stackView.layoutMarginsRelativeArrangement = YES; self.backgroundColor = [UIColor whiteColor]; [[self layer] setShadowOpacity:kShadowOpacity]; + [[self layer] setShadowRadius:kShadowRadius]; [self setEditing:NO]; } return self; @@ -216,11 +158,11 @@ #pragma mark Public Methods - (void)setEditing:(BOOL)editing { - self.editButtonContainer.hidden = editing; - self.deleteButtonContainer.hidden = YES; - self.deleteAllButtonContainer.hidden = !editing; - self.cancelButtonContainer.hidden = !editing; - self.markButtonContainer.hidden = !editing; + self.editButton.hidden = editing; + self.deleteButton.hidden = YES; + self.deleteAllButton.hidden = !editing; + self.cancelButton.hidden = !editing; + self.markButton.hidden = !editing; [self updateHeight]; } @@ -246,7 +188,7 @@ } - (void)setHasReadItem:(BOOL)hasRead { - self.deleteAllButton.enabled = hasRead; + [self.deleteAllButton setEnabled:hasRead]; } - (ActionSheetCoordinator*)actionSheetForMarkWithBaseViewController: @@ -262,78 +204,84 @@ #pragma mark Private Methods - (void)updateButtonsForEmptySelection { - self.deleteAllButtonContainer.hidden = NO; - self.deleteButtonContainer.hidden = YES; + self.deleteAllButton.hidden = NO; + self.deleteButton.hidden = YES; [self setMarkButtonText:l10n_util::GetNSStringWithFixup( IDS_IOS_READING_LIST_MARK_ALL_BUTTON)]; } - (void)updateButtonsForOnlyReadSelection { - self.deleteAllButtonContainer.hidden = YES; - self.deleteButtonContainer.hidden = NO; + self.deleteAllButton.hidden = YES; + self.deleteButton.hidden = NO; [self setMarkButtonText:l10n_util::GetNSStringWithFixup( IDS_IOS_READING_LIST_MARK_UNREAD_BUTTON)]; } - (void)updateButtonsForOnlyUnreadSelection { - self.deleteAllButtonContainer.hidden = YES; - self.deleteButtonContainer.hidden = NO; + self.deleteAllButton.hidden = YES; + self.deleteButton.hidden = NO; [self setMarkButtonText:l10n_util::GetNSStringWithFixup( IDS_IOS_READING_LIST_MARK_READ_BUTTON)]; } - (void)updateButtonsForOnlyMixedSelection { - self.deleteAllButtonContainer.hidden = YES; - self.deleteButtonContainer.hidden = NO; + self.deleteAllButton.hidden = YES; + self.deleteButton.hidden = NO; [self setMarkButtonText:l10n_util::GetNSStringWithFixup( IDS_IOS_READING_LIST_MARK_BUTTON)]; } -- (UIButton*)buttonWithText:(NSString*)title destructive:(BOOL)isDestructive { - UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; - button.contentEdgeInsets = UIEdgeInsetsMake(0, 8, 0, 8); - [button setTitle:title forState:UIControlStateNormal]; - button.titleLabel.numberOfLines = 3; - button.titleLabel.adjustsFontSizeToFitWidth = YES; - - button.backgroundColor = [UIColor whiteColor]; - UIColor* textColor = isDestructive ? [[MDCPalette cr_redPalette] tint500] - : [[MDCPalette cr_bluePalette] tint500]; - [button setTitleColor:textColor forState:UIControlStateNormal]; - [button setTitleColor:[UIColor lightGrayColor] - forState:UIControlStateDisabled]; - [button setTitleColor:[textColor colorWithAlphaComponent:0.3] - forState:UIControlStateHighlighted]; - [[button titleLabel] - setFont:[[MDCTypography fontLoader] regularFontOfSize:14]]; - - button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter; - button.titleLabel.textAlignment = NSTextAlignmentCenter; - - return button; -} - (void)setMarkButtonText:(NSString*)text { - [self.markButton setTitle:text forState:UIControlStateNormal]; + [self.markButton setTitle:text]; } - (void)updateHeight { - for (UIButton* button in - @[ _deleteButton, _deleteAllButton, _markButton, _cancelButton ]) { - if (!button.superview.hidden) { - CGFloat rect = [button.titleLabel.text - cr_pixelAlignedSizeWithFont:button.titleLabel.font] - .width; - if (rect > (self.frame.size.width - 2 * kHorizontalMargin - - 2 * kHorizontalSpacing) / - 3 - - 16) { - self.heightConstraint.constant = kToolbarExpandedHeight; - return; + NSArray* buttons = @[ + _editButton, _deleteButton, _deleteAllButton, _markButton, _cancelButton + ]; + + CGFloat availableWidth = self.frame.size.width - kHorizontalMargin * 2; + NSUInteger visibleCount = 0; + + // Count the number of visible buttons and deduct the button spacings from + // availableWidth. + for (ReadingListToolbarButton* button in buttons) { + if (!button.hidden) { + visibleCount++; + if (visibleCount > 1) { + availableWidth -= kHorizontalSpacing; } } } - self.heightConstraint.constant = kToolbarNormalHeight; + + // Set the button width manually here instead of relying on UIStackView's auto + // width distribution which is unpredictable when rounding happens. + CGFloat maxButtonWidth = ceil(availableWidth / visibleCount); + for (ReadingListToolbarButton* button in buttons) { + if (!button.hidden) { + [button setMaxWidth:maxButtonWidth]; + } + } + + CGFloat toolbarHeight = kToolbarNormalHeight; + CGFloat lineHeight = ceil([ReadingListToolbarButton textFont].lineHeight); + CGSize labelBounds = CGSizeMake(maxButtonWidth, CGFLOAT_MAX); + // Expand toolbar height in case word wrapping happens. + for (ReadingListToolbarButton* button in buttons) { + if (!button.hidden) { + CGFloat labelHeight = + [[button titleLabel] sizeThatFits:labelBounds].height; + if (labelHeight > lineHeight * 2) { + toolbarHeight = kToolbarThreeLinesHeight; + break; + } + if (labelHeight > lineHeight) { + toolbarHeight = kToolbarTwoLinesHeight; + } + } + } + self.heightConstraint.constant = toolbarHeight; } @end
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_toolbar_button.h b/ios/chrome/browser/ui/reading_list/reading_list_toolbar_button.h new file mode 100644 index 0000000..425a2b7 --- /dev/null +++ b/ios/chrome/browser/ui/reading_list/reading_list_toolbar_button.h
@@ -0,0 +1,43 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_READING_LIST_READING_LIST_TOOLBAR_BUTTON_H_ +#define IOS_CHROME_BROWSER_UI_READING_LIST_READING_LIST_TOOLBAR_BUTTON_H_ + +#import <UIKit/UIKit.h> + +typedef NS_ENUM(NSInteger, ButtonPositioning) { Leading, Centered, Trailing }; + +// A button class for the buttons in ReadingListToolBar's stackview. Handles +// the layout alignment of the button and its titleLabel. +@interface ReadingListToolbarButton : UIView + +// Initializer. +- (instancetype)initWithText:(NSString*)labelText + destructive:(BOOL)isDestructive + position:(ButtonPositioning)position; + +// Associates a target object and action method with the UIButton. +- (void)addTarget:(id)target + action:(SEL)action + forControlEvents:(UIControlEvents)controlEvents; + +// Sets the title text of the UIButton. +- (void)setTitle:(NSString*)title; + +// Enables or disables the UIButton. +- (void)setEnabled:(BOOL)enabled; + +// Gets the titleLabel of the UIButton. +- (UILabel*)titleLabel; + +// Sets the maximum width contraint of ReadingListToolbarButton. +- (void)setMaxWidth:(CGFloat)maxWidth; + +// The font of the title text. ++ (UIFont*)textFont; + +@end + +#endif // IOS_CHROME_BROWSER_UI_READING_LIST_READING_LIST_TOOLBAR_BUTTON_H_
diff --git a/ios/chrome/browser/ui/reading_list/reading_list_toolbar_button.mm b/ios/chrome/browser/ui/reading_list/reading_list_toolbar_button.mm new file mode 100644 index 0000000..0d96a97 --- /dev/null +++ b/ios/chrome/browser/ui/reading_list/reading_list_toolbar_button.mm
@@ -0,0 +1,174 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/reading_list/reading_list_toolbar_button.h" + +#include "base/logging.h" +#import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h" +#include "ios/chrome/browser/ui/rtl_geometry.h" +#import "ios/chrome/browser/ui/util/constraints_ui_util.h" +#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@interface ReadingListToolbarButton () + +// The actual UIButton object inside ReadingListToolbarButton. +@property(nonatomic, strong) UIButton* button; + +// Width constraint for the ReadingListToolbarButton. +@property(nonatomic, strong) NSLayoutConstraint* widthConstraint; + +@end + +@implementation ReadingListToolbarButton + +@synthesize button = _button; +@synthesize widthConstraint = _widthConstraint; + +#pragma mark - Public + +- (instancetype)initWithText:(NSString*)labelText + destructive:(BOOL)isDestructive + position:(ButtonPositioning)position { + self = [super init]; + if (!self) { + return self; + } + + _button = [self buttonWithText:labelText + destructive:isDestructive + position:position]; + _button.translatesAutoresizingMaskIntoConstraints = NO; + [self addSubview:_button]; + + NSDictionary* views = @{@"button" : _button}; + NSArray* constraints = nil; + + switch (position) { + case Leading: { + constraints = @[ @"V:|[button]|", @"H:|[button]" ]; + ApplyVisualConstraints(constraints, views); + [_button.trailingAnchor + constraintLessThanOrEqualToAnchor:self.trailingAnchor] + .active = YES; + break; + } + case Centered: { + constraints = @[ @"V:|[button]|" ]; + ApplyVisualConstraints(constraints, views); + [_button.centerXAnchor constraintEqualToAnchor:self.centerXAnchor] + .active = YES; + [_button.trailingAnchor + constraintLessThanOrEqualToAnchor:self.trailingAnchor] + .active = YES; + [_button.leadingAnchor + constraintGreaterThanOrEqualToAnchor:self.leadingAnchor] + .active = YES; + break; + } + case Trailing: { + constraints = @[ @"V:|[button]|", @"H:[button]|" ]; + ApplyVisualConstraints(constraints, views); + [_button.leadingAnchor + constraintGreaterThanOrEqualToAnchor:self.leadingAnchor] + .active = YES; + break; + } + } + return self; +} + +- (void)addTarget:(id)target + action:(SEL)action + forControlEvents:(UIControlEvents)controlEvents { + [self.button addTarget:target action:action forControlEvents:controlEvents]; +} + +- (void)setTitle:(NSString*)title { + [self.button setTitle:title forState:UIControlStateNormal]; +} + +- (void)setEnabled:(BOOL)enabled { + self.button.enabled = enabled; +} + +- (UILabel*)titleLabel { + return self.button.titleLabel; +} + +- (void)setMaxWidth:(CGFloat)maxWidth { + if (!self.widthConstraint) { + self.widthConstraint = + [self.button.widthAnchor constraintLessThanOrEqualToConstant:maxWidth]; + self.widthConstraint.active = YES; + } + self.widthConstraint.constant = maxWidth; +} + +#pragma mark - Private + +- (UIButton*)buttonWithText:(NSString*)title + destructive:(BOOL)isDestructive + position:(ButtonPositioning)position { + UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom]; + [button setTitle:title forState:UIControlStateNormal]; + button.titleLabel.numberOfLines = 3; + button.titleLabel.adjustsFontSizeToFitWidth = YES; + + button.backgroundColor = [UIColor whiteColor]; + UIColor* textColor = isDestructive ? [[MDCPalette cr_redPalette] tint500] + : [[MDCPalette cr_bluePalette] tint500]; + [button setTitleColor:textColor forState:UIControlStateNormal]; + [button setTitleColor:[UIColor lightGrayColor] + forState:UIControlStateDisabled]; + [button setTitleColor:[textColor colorWithAlphaComponent:0.3] + forState:UIControlStateHighlighted]; + [[button titleLabel] setFont:[[self class] textFont]]; + + switch (position) { + case Leading: { + button.titleLabel.textAlignment = NSTextAlignmentNatural; + if (UseRTLLayout()) { + button.contentHorizontalAlignment = + UIControlContentHorizontalAlignmentRight; + } else { + button.contentHorizontalAlignment = + UIControlContentHorizontalAlignmentLeft; + } + break; + } + case Centered: { + button.titleLabel.textAlignment = NSTextAlignmentCenter; + button.contentHorizontalAlignment = + UIControlContentHorizontalAlignmentCenter; + break; + } + case Trailing: { + if (UseRTLLayout()) { + button.titleLabel.textAlignment = NSTextAlignmentLeft; + button.contentHorizontalAlignment = + UIControlContentHorizontalAlignmentLeft; + } else { + button.titleLabel.textAlignment = NSTextAlignmentRight; + button.contentHorizontalAlignment = + UIControlContentHorizontalAlignmentRight; + } + break; + } + } + + return button; +} + +#pragma mark - Static Properties + +// The font of the title text. ++ (UIFont*)textFont { + return [MDCTypography subheadFont]; +} + +@end
diff --git a/third_party/WebKit/LayoutTests/fast/css/usecounter-pseudo-webkit-any-link.html b/third_party/WebKit/LayoutTests/fast/css/usecounter-pseudo-webkit-any-link.html new file mode 100644 index 0000000..dbd9a8e --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/css/usecounter-pseudo-webkit-any-link.html
@@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> + <head> + <title>Use counter test for :-webkit-any-link</title> + <script src="../../resources/testharness.js"></script> + <script src="../../resources/testharnessreport.js"></script> + <style id="style"></style> + <a href="http://google.com" id="link">Link</a> + <script> + 'use strict'; + test(() => { + let CSSSelectorPseudoWebkitAnyLink = 2260; // From UseCounter.h + let isCounted = () => internals.isUseCounted(document, CSSSelectorPseudoWebkitAnyLink); + var div = document.createElement('div'); + getComputedStyle(link); + assert_false(isCounted(), ':-webkit-any-link should not be counted'); + var style = document.getElementById('style'); + style.textContent = ':-webkit-any-link { color: blue; }'; + assert_equals(getComputedStyle(link).color, 'rgb(0, 0, 255)'); + assert_true(isCounted(), ':-webkit-any-link should be counted'); + }, ':-webkit-any-link counter is working'); + </script> + </head> +<html> \ No newline at end of file
diff --git a/third_party/WebKit/Source/core/css/SelectorChecker.cpp b/third_party/WebKit/Source/core/css/SelectorChecker.cpp index 90024e7..542df46 100644 --- a/third_party/WebKit/Source/core/css/SelectorChecker.cpp +++ b/third_party/WebKit/Source/core/css/SelectorChecker.cpp
@@ -900,6 +900,8 @@ return element.IsFormControlElement() && ToHTMLFormControlElement(element).IsAutofilled(); case CSSSelector::kPseudoAnyLink: + UseCounter::Count(context.element->GetDocument(), + WebFeature::kCSSSelectorPseudoWebkitAnyLink); case CSSSelector::kPseudoLink: return element.IsLink(); case CSSSelector::kPseudoVisited:
diff --git a/third_party/WebKit/public/platform/web_feature.mojom b/third_party/WebKit/public/platform/web_feature.mojom index 6c8a082..56507e95 100644 --- a/third_party/WebKit/public/platform/web_feature.mojom +++ b/third_party/WebKit/public/platform/web_feature.mojom
@@ -1778,6 +1778,7 @@ kLocalCSSFileExtensionRejected = 2257, kUserMediaDisableHardwareNoiseSuppression = 2258, kCertificateTransparencyRequiredErrorOnResourceLoad = 2259, + kCSSSelectorPseudoWebkitAnyLink = 2260, // Add new features immediately above this line. Don't change assigned // numbers of any item, and don't reuse removed slots.
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 9e46ec2..4fb13c9a 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -17112,6 +17112,7 @@ <int value="2257" label="LocalCSSFileExtensionRejected"/> <int value="2258" label="UserMediaDisableHardwareNoiseSuppression"/> <int value="2259" label="CertificateTransparencyRequiredErrorOnResourceLoad"/> + <int value="2260" label="CSSSelectorPseudoWebkitAnyLink"/> </enum> <enum name="FeedbackSource">
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 7e2c6735..1b61eb23 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -26314,6 +26314,9 @@ <histogram name="GeolocationDisclosure.PostDisclosureContentSetting" enum="ContentSetting"> + <obsolete> + Deprecated 2017/11. Use PostDisclosureDSESetting instead. + </obsolete> <owner>benwells@chromium.org</owner> <summary> Records the geolocation content setting for the default search engine's @@ -26347,6 +26350,9 @@ <histogram name="GeolocationDisclosure.PreDisclosureContentSetting" enum="ContentSetting"> + <obsolete> + Deprecated 2017/11. Use PreDisclosureDSESetting instead. + </obsolete> <owner>benwells@chromium.org</owner> <summary> Records the geolocation content setting for the default search engine's
diff --git a/ui/keyboard/keyboard_test_util.cc b/ui/keyboard/keyboard_test_util.cc index a39e654..30ae4e5 100644 --- a/ui/keyboard/keyboard_test_util.cc +++ b/ui/keyboard/keyboard_test_util.cc
@@ -49,8 +49,6 @@ void Wait() { run_loop_.Run(); } private: - void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override {} - void OnKeyboardClosed() override {} void OnStateChanged(const keyboard::KeyboardControllerState state) override { if (state == state_) { run_loop_.QuitWhenIdle();