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

Unified Diff: ui/views/examples/message_box_example.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/examples/message_box_example.h ('k') | ui/views/examples/multiline_example.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/message_box_example.cc
diff --git a/ui/views/examples/message_box_example.cc b/ui/views/examples/message_box_example.cc
deleted file mode 100644
index cb9e924fbf624c374666e2cf03603d57da555d3e..0000000000000000000000000000000000000000
--- a/ui/views/examples/message_box_example.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/views/examples/message_box_example.h"
-
-#include "base/strings/utf_string_conversions.h"
-#include "ui/views/controls/button/label_button.h"
-#include "ui/views/controls/message_box_view.h"
-#include "ui/views/layout/grid_layout.h"
-#include "ui/views/view.h"
-
-using base::ASCIIToUTF16;
-
-namespace views {
-namespace examples {
-
-MessageBoxExample::MessageBoxExample() : ExampleBase("Message Box View") {
-}
-
-MessageBoxExample::~MessageBoxExample() {
-}
-
-void MessageBoxExample::CreateExampleView(View* container) {
- message_box_view_ = new MessageBoxView(
- MessageBoxView::InitParams(ASCIIToUTF16("Hello, world!")));
- status_ = new LabelButton(this, ASCIIToUTF16("Show Status"));
- toggle_ = new LabelButton(this, ASCIIToUTF16("Toggle Checkbox"));
-
- GridLayout* layout = new GridLayout(container);
- container->SetLayoutManager(layout);
-
- message_box_view_->SetCheckBoxLabel(ASCIIToUTF16("Check Box"));
-
- const int message_box_column = 0;
- ColumnSet* column_set = layout->AddColumnSet(message_box_column);
- column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1,
- GridLayout::USE_PREF, 0, 0);
- layout->StartRow(1 /* expand */, message_box_column);
- layout->AddView(message_box_view_);
-
- const int button_column = 1;
- column_set = layout->AddColumnSet(button_column);
- column_set->AddColumn(GridLayout::FILL, GridLayout::FILL,
- 0.5f, GridLayout::USE_PREF, 0, 0);
- column_set->AddColumn(GridLayout::FILL, GridLayout::FILL,
- 0.5f, GridLayout::USE_PREF, 0, 0);
-
- layout->StartRow(0 /* no expand */, button_column);
-
- layout->AddView(status_);
- layout->AddView(toggle_);
-}
-
-void MessageBoxExample::ButtonPressed(Button* sender, const ui::Event& event) {
- if (sender == status_) {
- message_box_view_->SetCheckBoxLabel(
- ASCIIToUTF16(BoolToOnOff(message_box_view_->IsCheckBoxSelected())));
- PrintStatus(message_box_view_->IsCheckBoxSelected() ?
- "Check Box Selected" : "Check Box Not Selected");
- } else if (sender == toggle_) {
- message_box_view_->SetCheckBoxSelected(
- !message_box_view_->IsCheckBoxSelected());
- }
-}
-
-} // namespace examples
-} // namespace views
« no previous file with comments | « ui/views/examples/message_box_example.h ('k') | ui/views/examples/multiline_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698