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

Side by Side Diff: ui/views/examples/bubble_example.cc

Issue 8833004: Remove BubbleDelegateView ctor color arg, add simple setter/getter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass set_color SkColor arg by value. Created 9 years 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 | « ui/views/bubble/bubble_delegate_unittest.cc ('k') | 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 "ui/views/examples/bubble_example.h" 5 #include "ui/views/examples/bubble_example.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/views/bubble/bubble_delegate.h" 8 #include "ui/views/bubble/bubble_delegate.h"
9 #include "ui/views/controls/button/text_button.h" 9 #include "ui/views/controls/button/text_button.h"
10 #include "ui/views/controls/label.h" 10 #include "ui/views/controls/label.h"
(...skipping 20 matching lines...) Expand all
31 BubbleConfig kArrowConfig = { ASCIIToUTF16("Arrow"), SK_ColorGRAY, NULL, 31 BubbleConfig kArrowConfig = { ASCIIToUTF16("Arrow"), SK_ColorGRAY, NULL,
32 BubbleBorder::TOP_LEFT, false, false }; 32 BubbleBorder::TOP_LEFT, false, false };
33 BubbleConfig kFadeInConfig = { ASCIIToUTF16("FadeIn"), SK_ColorYELLOW, NULL, 33 BubbleConfig kFadeInConfig = { ASCIIToUTF16("FadeIn"), SK_ColorYELLOW, NULL,
34 BubbleBorder::BOTTOM_RIGHT, true, false }; 34 BubbleBorder::BOTTOM_RIGHT, true, false };
35 BubbleConfig kFadeOutConfig = { ASCIIToUTF16("FadeOut"), SK_ColorWHITE, NULL, 35 BubbleConfig kFadeOutConfig = { ASCIIToUTF16("FadeOut"), SK_ColorWHITE, NULL,
36 BubbleBorder::LEFT_TOP, false, true }; 36 BubbleBorder::LEFT_TOP, false, true };
37 37
38 class ExampleBubbleDelegateView : public BubbleDelegateView { 38 class ExampleBubbleDelegateView : public BubbleDelegateView {
39 public: 39 public:
40 ExampleBubbleDelegateView(const BubbleConfig& config) 40 ExampleBubbleDelegateView(const BubbleConfig& config)
41 : BubbleDelegateView(config.anchor_view, config.arrow, config.color), 41 : BubbleDelegateView(config.anchor_view, config.arrow),
42 label_(config.label) {} 42 label_(config.label) {
43 set_color(config.color);
44 }
43 45
44 protected: 46 protected:
45 virtual void Init() OVERRIDE { 47 virtual void Init() OVERRIDE {
46 SetLayoutManager(new FillLayout()); 48 SetLayoutManager(new FillLayout());
47 Label* label = new Label(label_); 49 Label* label = new Label(label_);
48 AddChildView(label); 50 AddChildView(label);
49 } 51 }
50 52
51 private: 53 private:
52 string16 label_; 54 string16 label_;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 bubble_delegate->Show(); 93 bubble_delegate->Show();
92 94
93 if (config.fade_out) { 95 if (config.fade_out) {
94 bubble_delegate->set_close_on_esc(false); 96 bubble_delegate->set_close_on_esc(false);
95 bubble_delegate->StartFade(false); 97 bubble_delegate->StartFade(false);
96 } 98 }
97 } 99 }
98 100
99 } // namespace examples 101 } // namespace examples
100 } // namespace views 102 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/bubble/bubble_delegate_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698