Chromium Code Reviews| 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_ |