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

Side by Side Diff: ui/aura_shell/examples/bubble.cc

Issue 7977016: aura_shell/examples: Fix build on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "views/bubble/bubble_border.h" 6 #include "views/bubble/bubble_border.h"
7 #include "views/bubble/bubble_delegate.h" 7 #include "views/bubble/bubble_delegate.h"
8 #include "views/bubble/bubble_view.h" 8 #include "views/bubble/bubble_view.h"
9 #include "views/controls/label.h" 9 #include "views/controls/label.h"
10 #include "views/widget/widget.h" 10 #include "views/widget/widget.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 void CreateBubble(const BubbleConfig& config, 44 void CreateBubble(const BubbleConfig& config,
45 gfx::NativeWindow parent) { 45 gfx::NativeWindow parent) {
46 views::Widget* bubble_widget = new views::Widget; 46 views::Widget* bubble_widget = new views::Widget;
47 views::Widget::InitParams params(views::Widget::InitParams::TYPE_BUBBLE); 47 views::Widget::InitParams params(views::Widget::InitParams::TYPE_BUBBLE);
48 params.delegate = new ExampleBubbleDelegateView(config, bubble_widget); 48 params.delegate = new ExampleBubbleDelegateView(config, bubble_widget);
49 params.transparent = true; 49 params.transparent = true;
50 params.bounds = config.bound; 50 params.bounds = config.bound;
51 params.parent = parent; 51 params.parent = parent;
52 bubble_widget->Init(params); 52 bubble_widget->Init(params);
53 bubble_widget->client_view()->AsBubbleView()->AddChildView( 53 bubble_widget->client_view()->AsBubbleView()->AddChildView(
54 new views::Label(L"I am a " + config.label)); 54 new views::Label(L"I am a " + UTF16ToWideHack(config.label)));
55 } 55 }
56 56
57 void CreatePointyBubble(gfx::NativeWindow parent, const gfx::Point& origin) { 57 void CreatePointyBubble(gfx::NativeWindow parent, const gfx::Point& origin) {
58 BubbleConfig config; 58 BubbleConfig config;
59 config.label = ASCIIToUTF16("PointyBubble"); 59 config.label = ASCIIToUTF16("PointyBubble");
60 config.color = SK_ColorWHITE; 60 config.color = SK_ColorWHITE;
61 config.bound = gfx::Rect(origin.x(), origin.y(), 180, 180); 61 config.bound = gfx::Rect(origin.x(), origin.y(), 180, 180);
62 config.arrow = views::BubbleBorder::TOP_LEFT; 62 config.arrow = views::BubbleBorder::TOP_LEFT;
63 config.fade_out = false; 63 config.fade_out = false;
64 CreateBubble(config, parent); 64 CreateBubble(config, parent);
65 } 65 }
66 66
67 } // namespace examples 67 } // namespace examples
68 } // namespace aura_shell 68 } // namespace aura_shell
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698