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

Side by Side Diff: ash/shell/bubble.cc

Issue 621133002: replace OVERRIDE and FINAL with override and final in ash/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « ash/shell/app_list.cc ('k') | ash/shell/content_client/shell_browser_main_parts.h » ('j') | 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/strings/utf_string_conversions.h" 5 #include "base/strings/utf_string_conversions.h"
6 #include "ui/views/bubble/bubble_border.h" 6 #include "ui/views/bubble/bubble_border.h"
7 #include "ui/views/bubble/bubble_delegate.h" 7 #include "ui/views/bubble/bubble_delegate.h"
8 #include "ui/views/controls/label.h" 8 #include "ui/views/controls/label.h"
9 #include "ui/views/layout/fill_layout.h" 9 #include "ui/views/layout/fill_layout.h"
10 #include "ui/views/widget/widget.h" 10 #include "ui/views/widget/widget.h"
11 11
12 namespace ash { 12 namespace ash {
13 namespace shell { 13 namespace shell {
14 14
15 struct BubbleConfig { 15 struct BubbleConfig {
16 base::string16 label; 16 base::string16 label;
17 views::View* anchor_view; 17 views::View* anchor_view;
18 views::BubbleBorder::Arrow arrow; 18 views::BubbleBorder::Arrow arrow;
19 }; 19 };
20 20
21 class ExampleBubbleDelegateView : public views::BubbleDelegateView { 21 class ExampleBubbleDelegateView : public views::BubbleDelegateView {
22 public: 22 public:
23 ExampleBubbleDelegateView(const BubbleConfig& config) 23 ExampleBubbleDelegateView(const BubbleConfig& config)
24 : BubbleDelegateView(config.anchor_view, config.arrow), 24 : BubbleDelegateView(config.anchor_view, config.arrow),
25 label_(config.label) {} 25 label_(config.label) {}
26 26
27 virtual void Init() OVERRIDE { 27 virtual void Init() override {
28 SetLayoutManager(new views::FillLayout()); 28 SetLayoutManager(new views::FillLayout());
29 views::Label* label = new views::Label(label_); 29 views::Label* label = new views::Label(label_);
30 AddChildView(label); 30 AddChildView(label);
31 } 31 }
32 32
33 private: 33 private:
34 base::string16 label_; 34 base::string16 label_;
35 }; 35 };
36 36
37 void CreatePointyBubble(views::View* anchor_view) { 37 void CreatePointyBubble(views::View* anchor_view) {
38 BubbleConfig config; 38 BubbleConfig config;
39 config.label = base::ASCIIToUTF16("PointyBubble"); 39 config.label = base::ASCIIToUTF16("PointyBubble");
40 config.anchor_view = anchor_view; 40 config.anchor_view = anchor_view;
41 config.arrow = views::BubbleBorder::TOP_LEFT; 41 config.arrow = views::BubbleBorder::TOP_LEFT;
42 ExampleBubbleDelegateView* bubble = new ExampleBubbleDelegateView(config); 42 ExampleBubbleDelegateView* bubble = new ExampleBubbleDelegateView(config);
43 views::BubbleDelegateView::CreateBubble(bubble)->Show(); 43 views::BubbleDelegateView::CreateBubble(bubble)->Show();
44 } 44 }
45 45
46 } // namespace shell 46 } // namespace shell
47 } // namespace ash 47 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/app_list.cc ('k') | ash/shell/content_client/shell_browser_main_parts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698