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

Unified Diff: views/examples/single_split_view_example.cc

Issue 6377004: views: Move the implementation of SingleSplitViewExample from the header file to the source file. (Closed)
Patch Set: Created 9 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 | « views/examples/single_split_view_example.h ('k') | views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/examples/single_split_view_example.cc
diff --git a/views/examples/single_split_view_example.cc b/views/examples/single_split_view_example.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8b15c4c1aa4fcfcc3f7950a0a697173443574386
--- /dev/null
+++ b/views/examples/single_split_view_example.cc
@@ -0,0 +1,66 @@
+// 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.
+
+#include "views/examples/single_split_view_example.h"
+
+namespace examples {
+
+SingleSplitViewExample::SingleSplitViewExample(ExamplesMain* main)
+ : ExampleBase(main) {
+}
+
+SingleSplitViewExample::~SingleSplitViewExample() {
+}
+
+std::wstring SingleSplitViewExample::GetExampleTitle() {
+ return L"Single Split View";
+}
+
+void SingleSplitViewExample::CreateExampleView(views::View* container) {
+ SplittedView* splitted_view_1 = new SplittedView();
+ SplittedView* splitted_view_2 = new SplittedView();
+
+ single_split_view_ = new views::SingleSplitView(
+ splitted_view_1, splitted_view_2,
+ views::SingleSplitView::HORIZONTAL_SPLIT,
+ NULL);
+
+ splitted_view_1->SetColor(SK_ColorYELLOW, SK_ColorCYAN);
+
+ views::GridLayout* layout = new views::GridLayout(container);
+ container->SetLayoutManager(layout);
+
+ // Add scroll view.
+ views::ColumnSet* column_set = layout->AddColumnSet(0);
+ column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1,
+ views::GridLayout::USE_PREF, 0, 0);
+ layout->StartRow(1, 0);
+ layout->AddView(single_split_view_);
+}
+
+SingleSplitViewExample::SplittedView::SplittedView() {
+ SetColor(SK_ColorRED, SK_ColorGREEN)_;
+}
+
+SingleSplitViewExample::SplittedView::~SplittedView() {
+}
+
+gfx::Size SingleSplitViewExample::SplittedView::GetPreferredSize() {
+ return gfx::Size(width(), height());
+}
+
+gfx::Size SingleSplitViewExample::SplittedView::GetMinimumSize() {
+ return gfx::Size(10, 10);
+}
+
+void SingleSplitViewExample::SplittedView::Layout() {
+ SizeToPreferredSize();
+}
+
+void SingleSplitViewExample::SplittedView::SetColor(SkColor from, SkColor to) {
+ set_background(
+ views::Background::CreateVerticalGradientBackground(from, to));
+}
+
+} // namespace examples
« no previous file with comments | « views/examples/single_split_view_example.h ('k') | views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698