OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/strings/utf_string_conversions.h" | 7 #include "base/strings/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/label_button.h" | 9 #include "ui/views/controls/button/label_button.h" |
10 #include "ui/views/controls/label.h" | 10 #include "ui/views/controls/label.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 return ASCIIToUTF16("INVALID"); | 48 return ASCIIToUTF16("INVALID"); |
49 } | 49 } |
50 | 50 |
51 class ExampleBubble : public BubbleDelegateView { | 51 class ExampleBubble : public BubbleDelegateView { |
52 public: | 52 public: |
53 ExampleBubble(View* anchor, BubbleBorder::Arrow arrow) | 53 ExampleBubble(View* anchor, BubbleBorder::Arrow arrow) |
54 : BubbleDelegateView(anchor, arrow) {} | 54 : BubbleDelegateView(anchor, arrow) {} |
55 | 55 |
56 protected: | 56 protected: |
57 virtual void Init() OVERRIDE { | 57 virtual void Init() override { |
58 SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 50, 50, 0)); | 58 SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 50, 50, 0)); |
59 AddChildView(new Label(GetArrowName(arrow()))); | 59 AddChildView(new Label(GetArrowName(arrow()))); |
60 } | 60 } |
61 | 61 |
62 private: | 62 private: |
63 DISALLOW_COPY_AND_ASSIGN(ExampleBubble); | 63 DISALLOW_COPY_AND_ASSIGN(ExampleBubble); |
64 }; | 64 }; |
65 | 65 |
66 } // namespace | 66 } // namespace |
67 | 67 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 BubbleDelegateView::CreateBubble(bubble); | 111 BubbleDelegateView::CreateBubble(bubble); |
112 if (sender == align_to_edge_) | 112 if (sender == align_to_edge_) |
113 bubble->SetAlignment(BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 113 bubble->SetAlignment(BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
114 | 114 |
115 bubble->GetWidget()->Show(); | 115 bubble->GetWidget()->Show(); |
116 } | 116 } |
117 | 117 |
118 } // namespace examples | 118 } // namespace examples |
119 } // namespace views | 119 } // namespace views |
OLD | NEW |