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

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

Issue 103493005: Rename View::set_focusable and View::set_accessibility_focusable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a few missing files Created 7 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/examples/tree_view_example.cc ('k') | ui/views/focus/focus_manager_unittest.cc » ('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) 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/widget_example.h" 5 #include "ui/views/examples/widget_example.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/views/background.h" 8 #include "ui/views/background.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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #if defined(OS_LINUX) 71 #if defined(OS_LINUX)
72 // Windows does not support TYPE_CONTROL top-level widgets. 72 // Windows does not support TYPE_CONTROL top-level widgets.
73 BuildButton(container, "Child widget", CHILD); 73 BuildButton(container, "Child widget", CHILD);
74 #endif 74 #endif
75 } 75 }
76 76
77 void WidgetExample::BuildButton(View* container, 77 void WidgetExample::BuildButton(View* container,
78 const std::string& label, 78 const std::string& label,
79 int tag) { 79 int tag) {
80 LabelButton* button = new LabelButton(this, ASCIIToUTF16(label)); 80 LabelButton* button = new LabelButton(this, ASCIIToUTF16(label));
81 button->set_focusable(true); 81 button->SetFocusable(true);
82 button->set_tag(tag); 82 button->set_tag(tag);
83 container->AddChildView(button); 83 container->AddChildView(button);
84 } 84 }
85 85
86 void WidgetExample::ShowWidget(View* sender, Widget::InitParams params) { 86 void WidgetExample::ShowWidget(View* sender, Widget::InitParams params) {
87 // Setup shared Widget heirarchy and bounds parameters. 87 // Setup shared Widget heirarchy and bounds parameters.
88 params.parent = sender->GetWidget()->GetNativeView(); 88 params.parent = sender->GetWidget()->GetNativeView();
89 params.bounds = gfx::Rect(sender->GetBoundsInScreen().CenterPoint(), 89 params.bounds = gfx::Rect(sender->GetBoundsInScreen().CenterPoint(),
90 gfx::Size(300, 200)); 90 gfx::Size(300, 200));
91 91
(...skipping 26 matching lines...) Expand all
118 ShowWidget(sender, Widget::InitParams(Widget::InitParams::TYPE_CONTROL)); 118 ShowWidget(sender, Widget::InitParams(Widget::InitParams::TYPE_CONTROL));
119 break; 119 break;
120 case CLOSE_WIDGET: 120 case CLOSE_WIDGET:
121 sender->GetWidget()->Close(); 121 sender->GetWidget()->Close();
122 break; 122 break;
123 } 123 }
124 } 124 }
125 125
126 } // namespace examples 126 } // namespace examples
127 } // namespace views 127 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/tree_view_example.cc ('k') | ui/views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698