OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/touchui/touch_editing_menu.h" | 5 #include "ui/views/touchui/touch_editing_menu.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "grit/ui_strings.h" | 8 #include "grit/ui_strings.h" |
9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 set_parent_window(context); | 70 set_parent_window(context); |
71 set_margins(gfx::Insets()); | 71 set_margins(gfx::Insets()); |
72 set_use_focusless(true); | 72 set_use_focusless(true); |
73 set_adjust_if_offscreen(true); | 73 set_adjust_if_offscreen(true); |
74 | 74 |
75 SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, 0, 0, | 75 SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, 0, 0, |
76 kSpacingBetweenButtons)); | 76 kSpacingBetweenButtons)); |
77 CreateButtons(); | 77 CreateButtons(); |
78 views::BubbleDelegateView::CreateBubble(this); | 78 views::BubbleDelegateView::CreateBubble(this); |
79 GetBubbleFrameView()->set_background(NULL); | 79 GetBubbleFrameView()->set_background(NULL); |
80 Show(); | 80 GetWidget()->Show(); |
81 } | 81 } |
82 | 82 |
83 TouchEditingMenuView::~TouchEditingMenuView() { | 83 TouchEditingMenuView::~TouchEditingMenuView() { |
84 } | 84 } |
85 | 85 |
86 void TouchEditingMenuView::Close() { | 86 void TouchEditingMenuView::Close() { |
87 if (GetWidget()) { | 87 if (GetWidget()) { |
88 controller_ = NULL; | 88 controller_ = NULL; |
89 GetWidget()->Close(); | 89 GetWidget()->Close(); |
90 } | 90 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 button->set_focusable(true); | 142 button->set_focusable(true); |
143 button->set_request_focus_on_press(false); | 143 button->set_request_focus_on_press(false); |
144 button->set_border(new TouchEditingMenuButtonBorder(button->style())); | 144 button->set_border(new TouchEditingMenuButtonBorder(button->style())); |
145 button->SetFont(ui::ResourceBundle::GetSharedInstance().GetFont( | 145 button->SetFont(ui::ResourceBundle::GetSharedInstance().GetFont( |
146 ui::ResourceBundle::SmallFont)); | 146 ui::ResourceBundle::SmallFont)); |
147 button->set_tag(tag); | 147 button->set_tag(tag); |
148 return button; | 148 return button; |
149 } | 149 } |
150 | 150 |
151 } // namespace views | 151 } // namespace views |
OLD | NEW |