Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: ash/wm/immersive_fullscreen_controller.cc

Issue 1922813002: Vanquish views::BubbleDelegate{View,} (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit tests Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/wm/immersive_fullscreen_controller.cc
diff --git a/ash/wm/immersive_fullscreen_controller.cc b/ash/wm/immersive_fullscreen_controller.cc
index cd6bd3defd2f6df99fdeecfe3767a00ef1536df7..085256ae998e7dbf3ffdcc905a6a9b65b3357214 100644
--- a/ash/wm/immersive_fullscreen_controller.cc
+++ b/ash/wm/immersive_fullscreen_controller.cc
@@ -24,7 +24,6 @@
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/screen.h"
-#include "ui/views/bubble/bubble_delegate.h"
#include "ui/views/bubble/bubble_dialog_delegate.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget.h"
@@ -64,19 +63,6 @@ const int kSwipeVerticalThresholdMultiplier = 3;
// See ShouldIgnoreMouseEventAtLocation() for more details.
const int kHeightOfDeadRegionAboveTopContainer = 10;
-// Returns the BubbleDelegateView corresponding to |maybe_bubble| if
-// |maybe_bubble| is a bubble. TODO(estade): remove this when all bubbles are
-// BubbleDialogDelegateViews, or create a common interface for the two bubble
-// types.
-views::BubbleDelegateView* AsBubbleDelegate(aura::Window* maybe_bubble) {
- if (!maybe_bubble)
- return nullptr;
- views::Widget* widget = views::Widget::GetWidgetForNativeView(maybe_bubble);
- if (!widget)
- return nullptr;
- return widget->widget_delegate()->AsBubbleDelegate();
-}
-
// Returns the BubbleDialogDelegateView corresponding to |maybe_bubble| if
// |maybe_bubble| is a bubble.
views::BubbleDialogDelegateView* AsBubbleDialogDelegate(
@@ -90,10 +76,6 @@ views::BubbleDialogDelegateView* AsBubbleDialogDelegate(
}
views::View* GetAnchorView(aura::Window* maybe_bubble) {
- views::BubbleDelegateView* bubble = AsBubbleDelegate(maybe_bubble);
- if (bubble)
- return bubble->GetAnchorView();
-
views::BubbleDialogDelegateView* bubble_dialog =
AsBubbleDialogDelegate(maybe_bubble);
return bubble_dialog ? bubble_dialog->GetAnchorView() : nullptr;
@@ -237,15 +219,11 @@ void ImmersiveFullscreenController::BubbleObserver::UpdateRevealedLock() {
// Currently, there is no nice way for bubbles to reposition themselves
// whenever the anchor view moves. Tell the bubbles to reposition themselves
// explicitly instead. The hidden bubbles are also repositioned because
- // BubbleDelegateView does not reposition its widget as a result of a
+ // BubbleDialogDelegateView does not reposition its widget as a result of a
// visibility change.
for (std::set<aura::Window*>::const_iterator it = bubbles_.begin();
msw 2016/04/26 18:07:30 optional nit: for (auto bubble : bubbles_) and dro
Evan Stade 2016/04/26 21:23:01 Done (x3)
it != bubbles_.end(); ++it) {
- views::BubbleDelegateView* bubble = AsBubbleDelegate(*it);
- if (bubble)
- bubble->OnAnchorBoundsChanged();
- else
- AsBubbleDialogDelegate(*it)->OnAnchorBoundsChanged();
+ AsBubbleDialogDelegate(*it)->OnAnchorBoundsChanged();
}
}
}
« no previous file with comments | « no previous file | ash/wm/immersive_fullscreen_controller_unittest.cc » ('j') | ash/wm/immersive_fullscreen_controller_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698