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

Unified Diff: ui/views/bubble/bubble_dialog_delegate.h

Issue 1717453003: Introduce BubbleDialogDelegateView, which extends DialogDelegateView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 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: ui/views/bubble/bubble_dialog_delegate.h
diff --git a/ui/views/bubble/bubble_delegate.h b/ui/views/bubble/bubble_dialog_delegate.h
similarity index 87%
copy from ui/views/bubble/bubble_delegate.h
copy to ui/views/bubble/bubble_dialog_delegate.h
index a0e3ccc6292828c331f0af151041ce24e74145b1..042855086fd559a8ec4a062def7476728d6a54f9 100644
--- a/ui/views/bubble/bubble_delegate.h
+++ b/ui/views/bubble/bubble_dialog_delegate.h
@@ -1,16 +1,16 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2016 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 UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_
-#define UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_
+#ifndef UI_VIEWS_BUBBLE_BUBBLE_DIALOG_DELEGATE_H_
+#define UI_VIEWS_BUBBLE_BUBBLE_DIALOG_DELEGATE_H_
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "ui/views/bubble/bubble_border.h"
#include "ui/views/widget/widget.h"
-#include "ui/views/widget/widget_delegate.h"
#include "ui/views/widget/widget_observer.h"
+#include "ui/views/window/dialog_delegate.h"
namespace gfx {
class FontList;
@@ -21,10 +21,11 @@ namespace views {
class BubbleFrameView;
-// BubbleDelegateView creates frame and client views for bubble Widgets.
-// BubbleDelegateView itself is the client's contents view.
-class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
- public WidgetObserver {
+// BubbleDialogDelegateView is a special DialogDelegateView for bubbles. It
+// should be used in place of BubbleDelegateView as it shares more code with
msw 2016/02/22 21:43:56 Can you rephrase this sentence? Why does the code
Evan Stade 2016/02/22 22:58:23 Done.
+// DialogDelegateView.
+class VIEWS_EXPORT BubbleDialogDelegateView : public DialogDelegateView,
+ public WidgetObserver {
public:
// Internal class name.
static const char kViewClassName[];
@@ -36,17 +37,14 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
UNKNOWN,
};
- BubbleDelegateView();
- BubbleDelegateView(View* anchor_view, BubbleBorder::Arrow arrow);
- ~BubbleDelegateView() override;
+ ~BubbleDialogDelegateView() override;
// Create and initialize the bubble Widget(s) with proper bounds.
- static Widget* CreateBubble(BubbleDelegateView* bubble_delegate);
+ static Widget* CreateBubble(BubbleDialogDelegateView* bubble_delegate);
// WidgetDelegateView overrides:
- BubbleDelegateView* AsBubbleDelegate() override;
bool ShouldShowCloseButton() const override;
- View* GetContentsView() override;
+ ClientView* CreateClientView(Widget* widget) override;
NonClientFrameView* CreateNonClientFrameView(Widget* widget) override;
void GetAccessibleState(ui::AXViewState* state) override;
const char* GetClassName() const override;
@@ -111,9 +109,6 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
virtual void OnBeforeBubbleWidgetInit(Widget::InitParams* params,
Widget* widget) const;
- // Creates and returns a view to be displayed at the bottom of the bubble.
- virtual scoped_ptr<View> CreateFootnoteView();
-
// Sets |margins_| to a default picked for smaller bubbles.
void UseCompactMargins();
@@ -130,6 +125,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
void OnAnchorBoundsChanged();
protected:
+ BubbleDialogDelegateView();
+ BubbleDialogDelegateView(View* anchor_view, BubbleBorder::Arrow arrow);
+
// Get bubble bounds from the anchor rect and client view's preferred size.
virtual gfx::Rect GetBubbleBounds();
@@ -211,9 +209,9 @@ class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView,
CloseReason close_reason_;
- DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView);
+ DISALLOW_COPY_AND_ASSIGN(BubbleDialogDelegateView);
};
} // namespace views
-#endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE_H_
+#endif // UI_VIEWS_BUBBLE_BUBBLE_DELEGATE2_H_

Powered by Google App Engine
This is Rietveld 408576698