summaryrefslogtreecommitdiffstats
path: root/ui/views/examples
diff options
context:
space:
mode:
authorflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-11 19:33:45 +0000
committerflackr@chromium.org <flackr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-11 19:33:45 +0000
commita50ef0211408cff79eb0dcea21dfd4df04c9a284 (patch)
treed81725a87e2e71e47d2c8df374cfbb73b00239bd /ui/views/examples
parent13c843c7fc703383a7f7a2dc06bb6939bc9ebc54 (diff)
downloadchromium_src-a50ef0211408cff79eb0dcea21dfd4df04c9a284.zip
chromium_src-a50ef0211408cff79eb0dcea21dfd4df04c9a284.tar.gz
chromium_src-a50ef0211408cff79eb0dcea21dfd4df04c9a284.tar.bz2
Revert 117228 - Adds a trivial views based table implementation (only supports single
selection, even for grouptableview) and wires it up for hung renderer and ssl client certificate. This broke linux chromeos clang compile: http://build.chromium.org/p/chromium.chromiumos/builders/Linux%20Clang%20%28ChromeOS%20dbg%29/builds/5737/steps/compile/logs/stdio BUG=109665 TEST=none R=ben@chromium.org Review URL: http://codereview.chromium.org/9181019 TBR=sky@chromium.org Review URL: http://codereview.chromium.org/9190013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/examples')
-rw-r--r--ui/views/examples/examples_window.cc9
-rw-r--r--ui/views/examples/table_example.cc29
2 files changed, 15 insertions, 23 deletions
diff --git a/ui/views/examples/examples_window.cc b/ui/views/examples/examples_window.cc
index b43c516..835ae1f 100644
--- a/ui/views/examples/examples_window.cc
+++ b/ui/views/examples/examples_window.cc
@@ -28,7 +28,6 @@
#include "ui/views/examples/scroll_view_example.h"
#include "ui/views/examples/single_split_view_example.h"
#include "ui/views/examples/tabbed_pane_example.h"
-#include "ui/views/examples/table_example.h"
#include "ui/views/examples/text_example.h"
#include "ui/views/examples/textfield_example.h"
#include "ui/views/examples/throbber_example.h"
@@ -40,7 +39,11 @@
#if !defined(USE_AURA)
#include "ui/views/examples/menu_example.h"
+#if defined(OS_WIN)
+#include "ui/views/examples/table_example.h"
#endif
+#endif
+
namespace views {
namespace examples {
@@ -108,7 +111,6 @@ class ExamplesWindowContents : public views::WidgetDelegateView {
// Adds all the individual examples to the tab strip.
void AddExamples() {
AddExample(new TreeViewExample);
- AddExample(new TableExample);
AddExample(new BubbleExample);
AddExample(new ButtonExample);
AddExample(new ComboboxExample);
@@ -125,6 +127,9 @@ class ExamplesWindowContents : public views::WidgetDelegateView {
AddExample(new ScrollViewExample);
AddExample(new SingleSplitViewExample);
AddExample(new TabbedPaneExample);
+#if !defined(USE_AURA) && defined(OS_WIN)
+ AddExample(new TableExample);
+#endif
AddExample(new TextExample);
AddExample(new TextfieldExample);
AddExample(new ThrobberExample);
diff --git a/ui/views/examples/table_example.cc b/ui/views/examples/table_example.cc
index 2a8f695..7dfbb1e 100644
--- a/ui/views/examples/table_example.cc
+++ b/ui/views/examples/table_example.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -6,7 +6,6 @@
#include <vector>
-#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/views/controls/button/checkbox.h"
@@ -43,16 +42,10 @@ void TableExample::CreateExampleView(View* container) {
container->SetLayoutManager(layout);
std::vector<ui::TableColumn> columns;
- columns.push_back(ui::TableColumn(0, ASCIIToUTF16("Fruit"),
- ui::TableColumn::LEFT, 100));
-#if !defined(USE_AURA)
- columns.push_back(ui::TableColumn(1, ASCIIToUTF16("Color"),
- ui::TableColumn::LEFT, 100));
- columns.push_back(ui::TableColumn(2, ASCIIToUTF16("Origin"),
- ui::TableColumn::LEFT, 100));
- columns.push_back(ui::TableColumn(3, ASCIIToUTF16("Price"),
- ui::TableColumn::LEFT, 100));
-#endif
+ columns.push_back(ui::TableColumn(0, L"Fruit", ui::TableColumn::LEFT, 100));
+ columns.push_back(ui::TableColumn(1, L"Color", ui::TableColumn::LEFT, 100));
+ columns.push_back(ui::TableColumn(2, L"Origin", ui::TableColumn::LEFT, 100));
+ columns.push_back(ui::TableColumn(3, L"Price", ui::TableColumn::LEFT, 100));
table_ = new TableView(this, columns, ICON_AND_TEXT, true, true, true);
table_->SetObserver(this);
icon1_.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
@@ -69,7 +62,7 @@ void TableExample::CreateExampleView(View* container) {
column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1,
GridLayout::USE_PREF, 0, 0);
layout->StartRow(1 /* expand */, 0);
- layout->AddView(table_->CreateParentIfNecessary());
+ layout->AddView(table_);
column_set = layout->AddColumnSet(1);
column_set->AddColumn(GridLayout::FILL, GridLayout::FILL,
@@ -111,14 +104,10 @@ SkBitmap TableExample::GetIcon(int row) {
void TableExample::SetObserver(ui::TableModelObserver* observer) {}
void TableExample::OnSelectionChanged() {
- PrintStatus("Selected: %s",
- UTF16ToASCII(GetText(table_->FirstSelectedRow(), 0)).c_str());
+ PrintStatus("Selection changed");
}
-void TableExample::OnDoubleClick() {
- PrintStatus("Double Click: %s",
- UTF16ToASCII(GetText(table_->FirstSelectedRow(), 0)).c_str());
-}
+void TableExample::OnDoubleClick() {}
void TableExample::OnMiddleClick() {}
@@ -144,9 +133,7 @@ void TableExample::ButtonPressed(Button* sender, const Event& event) {
index = 3;
show = column4_visible_checkbox_->checked();
}
-#if !defined(USE_AURA)
table_->SetColumnVisibility(index, show);
-#endif
}
} // namespace examples