summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-11 20:43:16 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-11 20:43:16 +0000
commit51a4dc719239e4c22b64fc641251443f09022300 (patch)
tree2e5267a7c934c305ae8f3147ffdc4be847ce3189 /ui
parent0edfffdee7e6b18247190e1aec262a711fa9aa3f (diff)
downloadchromium_src-51a4dc719239e4c22b64fc641251443f09022300.zip
chromium_src-51a4dc719239e4c22b64fc641251443f09022300.tar.gz
chromium_src-51a4dc719239e4c22b64fc641251443f09022300.tar.bz2
Rebase BookmarkBubble on the new views bubble.
Use a View instead of a Point for anchoring the bubble. Remove the now unused IDS_BOOKMARK_BUBBLE_ADD_BOOKMARK. Remove the unused BubbleDelegate base class from StarView. BUG=97248,98312,98323 TEST=Bookmark bubble has the same behavior/appearance. Review URL: http://codereview.chromium.org/8368016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/aura_shell/examples/bubble.cc13
-rw-r--r--ui/aura_shell/examples/example_factory.h9
-rw-r--r--ui/aura_shell/examples/window_type_launcher.cc4
3 files changed, 9 insertions, 17 deletions
diff --git a/ui/aura_shell/examples/bubble.cc b/ui/aura_shell/examples/bubble.cc
index 210b3f8..ff0e7a1 100644
--- a/ui/aura_shell/examples/bubble.cc
+++ b/ui/aura_shell/examples/bubble.cc
@@ -15,20 +15,19 @@ namespace examples {
struct BubbleConfig {
string16 label;
SkColor color;
- gfx::Point anchor_point;
+ views::View* anchor_view;
views::BubbleBorder::ArrowLocation arrow;
};
class ExampleBubbleDelegateView : public views::BubbleDelegateView {
public:
ExampleBubbleDelegateView(const BubbleConfig& config)
- : BubbleDelegateView(config.anchor_point, config.arrow, config.color),
+ : BubbleDelegateView(config.anchor_view, config.arrow, config.color),
label_(config.label) {}
virtual void Init() OVERRIDE {
SetLayoutManager(new views::FillLayout());
views::Label* label = new views::Label(label_);
- label->set_border(views::Border::CreateSolidBorder(10, GetColor()));
AddChildView(label);
}
@@ -36,14 +35,14 @@ class ExampleBubbleDelegateView : public views::BubbleDelegateView {
string16 label_;
};
-void CreatePointyBubble(views::Widget* parent, const gfx::Point& origin) {
+void CreatePointyBubble(views::View* anchor_view) {
BubbleConfig config;
config.label = ASCIIToUTF16("PointyBubble");
config.color = SK_ColorWHITE;
- config.anchor_point = origin;
+ config.anchor_view = anchor_view;
config.arrow = views::BubbleBorder::TOP_LEFT;
- views::Widget* bubble = views::BubbleDelegateView::CreateBubble(
- new ExampleBubbleDelegateView(config), parent);
+ ExampleBubbleDelegateView* bubble = new ExampleBubbleDelegateView(config);
+ views::BubbleDelegateView::CreateBubble(bubble);
bubble->Show();
}
diff --git a/ui/aura_shell/examples/example_factory.h b/ui/aura_shell/examples/example_factory.h
index da60715..8e18419 100644
--- a/ui/aura_shell/examples/example_factory.h
+++ b/ui/aura_shell/examples/example_factory.h
@@ -8,18 +8,14 @@
#include "ui/gfx/native_widget_types.h"
-namespace gfx {
-class Point;
-}
-
namespace views {
-class Widget;
+class View;
}
namespace aura_shell {
namespace examples {
-void CreatePointyBubble(views::Widget* parent, const gfx::Point& origin);
+void CreatePointyBubble(views::View* anchor_view);
void CreateLock();
@@ -29,5 +25,4 @@ void CreateWidgetsWindow();
} // namespace examples
} // namespace aura_shell
-
#endif // UI_AURA_SHELL_SHELL_FACTORY_H_
diff --git a/ui/aura_shell/examples/window_type_launcher.cc b/ui/aura_shell/examples/window_type_launcher.cc
index 2b9312a..37cc500 100644
--- a/ui/aura_shell/examples/window_type_launcher.cc
+++ b/ui/aura_shell/examples/window_type_launcher.cc
@@ -124,9 +124,7 @@ void WindowTypeLauncher::ButtonPressed(views::Button* sender,
} else if (sender == create_nonresizable_button_) {
ToplevelWindow::CreateToplevelWindow(ToplevelWindow::CreateParams());
} else if (sender == bubble_button_) {
- gfx::Point origin = bubble_button_->bounds().origin();
- views::View::ConvertPointToScreen(bubble_button_->parent(), &origin);
- CreatePointyBubble(GetWidget(), origin);
+ CreatePointyBubble(sender);
} else if (sender == lock_button_) {
CreateLock();
} else if (sender == widgets_button_) {