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

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

Issue 659233002: STASH: Epic Experimental patch for toolkit-views App List on Mac Base URL: https://chromium.googlesource.com/chromium/src.git/+/master
Patch Set: Fix a few things. Works@master 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 | « ui/views/examples/widget_example.h ('k') | ui/views/test/test_views_delegate.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) 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 68
69 void WidgetExample::CreateExampleView(View* container) { 69 void WidgetExample::CreateExampleView(View* container) {
70 container->SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, 0, 0, 10)); 70 container->SetLayoutManager(new BoxLayout(BoxLayout::kHorizontal, 0, 0, 10));
71 BuildButton(container, "Popup widget", POPUP); 71 BuildButton(container, "Popup widget", POPUP);
72 BuildButton(container, "Dialog widget", DIALOG); 72 BuildButton(container, "Dialog widget", DIALOG);
73 #if defined(OS_LINUX) 73 #if defined(OS_LINUX)
74 // Windows does not support TYPE_CONTROL top-level widgets. 74 // Windows does not support TYPE_CONTROL top-level widgets.
75 BuildButton(container, "Child widget", CHILD); 75 BuildButton(container, "Child widget", CHILD);
76 #endif 76 #endif
77 BuildButton(container, "Minimize", MINIMIZE);
78 BuildButton(container, "Maximize", MAXIMIZE);
79 BuildButton(container, "Fullscreen", FULLSCREEN_ON);
80 BuildButton(container, "Un-Fullscreen", FULLSCREEN_OFF);
77 } 81 }
78 82
79 void WidgetExample::BuildButton(View* container, 83 void WidgetExample::BuildButton(View* container,
80 const std::string& label, 84 const std::string& label,
81 int tag) { 85 int tag) {
82 LabelButton* button = new LabelButton(this, ASCIIToUTF16(label)); 86 LabelButton* button = new LabelButton(this, ASCIIToUTF16(label));
83 button->SetFocusable(true); 87 button->SetFocusable(true);
84 button->set_tag(tag); 88 button->set_tag(tag);
85 container->AddChildView(button); 89 container->AddChildView(button);
86 } 90 }
(...skipping 28 matching lines...) Expand all
115 DialogDelegate::CreateDialogWidget(new DialogExample(), NULL, 119 DialogDelegate::CreateDialogWidget(new DialogExample(), NULL,
116 sender->GetWidget()->GetNativeView())->Show(); 120 sender->GetWidget()->GetNativeView())->Show();
117 break; 121 break;
118 } 122 }
119 case CHILD: 123 case CHILD:
120 ShowWidget(sender, Widget::InitParams(Widget::InitParams::TYPE_CONTROL)); 124 ShowWidget(sender, Widget::InitParams(Widget::InitParams::TYPE_CONTROL));
121 break; 125 break;
122 case CLOSE_WIDGET: 126 case CLOSE_WIDGET:
123 sender->GetWidget()->Close(); 127 sender->GetWidget()->Close();
124 break; 128 break;
129 case MINIMIZE:
130 sender->GetWidget()->Minimize();
131 break;
132 case MAXIMIZE:
133 sender->GetWidget()->Maximize();
134 break;
135 case FULLSCREEN_ON:
136 sender->GetWidget()->SetFullscreen(true);
137 break;
138 case FULLSCREEN_OFF:
139 sender->GetWidget()->SetFullscreen(false);
140 break;
125 } 141 }
126 } 142 }
127 143
128 } // namespace examples 144 } // namespace examples
129 } // namespace views 145 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/widget_example.h ('k') | ui/views/test/test_views_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698