diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-20 19:54:34 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-20 19:54:34 +0000 |
commit | 0a00ea33d6feec80e32acc4ff28ec6bcbf46aaf3 (patch) | |
tree | 957a315830daa8dc2c32700b738de17826a08222 /ui/aura_shell | |
parent | 8a63cdc2e561499235c646d18efa0371064cec51 (diff) | |
download | chromium_src-0a00ea33d6feec80e32acc4ff28ec6bcbf46aaf3.zip chromium_src-0a00ea33d6feec80e32acc4ff28ec6bcbf46aaf3.tar.gz chromium_src-0a00ea33d6feec80e32acc4ff28ec6bcbf46aaf3.tar.bz2 |
Move BubbleView logic into BubbleDelegateView.
Add customization ctor; override GetInitiallyFocusedView.
BUG=97248,98322,98323
TEST=views_examples bubbles work as before.
Review URL: http://codereview.chromium.org/8349015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@106546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura_shell')
-rw-r--r-- | ui/aura_shell/examples/bubble.cc | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/ui/aura_shell/examples/bubble.cc b/ui/aura_shell/examples/bubble.cc index bea8cb8..210b3f8 100644 --- a/ui/aura_shell/examples/bubble.cc +++ b/ui/aura_shell/examples/bubble.cc @@ -5,7 +5,6 @@ #include "base/utf_string_conversions.h" #include "views/bubble/bubble_border.h" #include "views/bubble/bubble_delegate.h" -#include "views/bubble/bubble_view.h" #include "views/controls/label.h" #include "views/layout/fill_layout.h" #include "views/widget/widget.h" @@ -23,29 +22,18 @@ struct BubbleConfig { class ExampleBubbleDelegateView : public views::BubbleDelegateView { public: ExampleBubbleDelegateView(const BubbleConfig& config) - : config_(config) {} - - virtual gfx::Point GetAnchorPoint() const OVERRIDE { - return config_.anchor_point; - } - - views::BubbleBorder::ArrowLocation GetArrowLocation() const OVERRIDE { - return config_.arrow; - } - - SkColor GetColor() const OVERRIDE { - return config_.color; -} + : BubbleDelegateView(config.anchor_point, config.arrow, config.color), + label_(config.label) {} virtual void Init() OVERRIDE { SetLayoutManager(new views::FillLayout()); - views::Label* label = new views::Label(config_.label); - label->set_border(views::Border::CreateSolidBorder(10, config_.color)); + views::Label* label = new views::Label(label_); + label->set_border(views::Border::CreateSolidBorder(10, GetColor())); AddChildView(label); } private: - const BubbleConfig config_; + string16 label_; }; void CreatePointyBubble(views::Widget* parent, const gfx::Point& origin) { |