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

Unified Diff: ui/aura_shell/examples/bubble.cc

Issue 8368016: Rebase BookmarkBubble on the new views bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only SelectAll on the title textfield when the buble is first shown. Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.cc ('k') | ui/aura_shell/examples/example_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/examples/bubble.cc
diff --git a/ui/aura_shell/examples/bubble.cc b/ui/aura_shell/examples/bubble.cc
index 210b3f863a2db55a7596649772eebcb5cde058fd..ff0e7a13f9786ec59bf80fec7bd85a9e8c6aac48 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();
}
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.cc ('k') | ui/aura_shell/examples/example_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698