Index: views/examples/single_split_view_example.h |
diff --git a/views/examples/single_split_view_example.h b/views/examples/single_split_view_example.h |
index 73d69a6718ad68b723cb6f7612c95e845abf4bfd..4c07e15c4cbc71cab7fae08e21b527c567bcb915 100644 |
--- a/views/examples/single_split_view_example.h |
+++ b/views/examples/single_split_view_example.h |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2010 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. |
@@ -13,64 +13,29 @@ namespace examples { |
class SingleSplitViewExample : public ExampleBase { |
public: |
- explicit SingleSplitViewExample(ExamplesMain* main) |
- : ExampleBase(main) { |
- } |
+ explicit SingleSplitViewExample(ExamplesMain* main); |
+ virtual ~SingleSplitViewExample(); |
- virtual ~SingleSplitViewExample() {} |
- |
- virtual std::wstring GetExampleTitle() { |
- return L"Single Split View"; |
- } |
- |
- virtual void 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_); |
- } |
+ // Overridden from ExampleBase: |
+ virtual std::wstring GetExampleTitle(); |
+ virtual void CreateExampleView(views::View* container); |
private: |
// SingleSplitView's content, which draws gradient color on background. |
class SplittedView : public views::View { |
public: |
- SplittedView() { |
- SetColor(SK_ColorRED, SK_ColorGREEN); |
- } |
- |
- virtual gfx::Size GetPreferredSize() { |
- return gfx::Size(width(), height()); |
- } |
+ SplittedView(); |
+ virtual ~SplittedView(); |
- virtual gfx::Size GetMinimumSize() { |
- return gfx::Size(10, 10); |
- } |
+ // Overridden from views::View: |
+ virtual gfx::Size GetPreferredSize(); |
+ virtual gfx::Size GetMinimumSize(); |
+ virtual void Layout(); |
- void SetColor(SkColor from, SkColor to) { |
- set_background( |
- views::Background::CreateVerticalGradientBackground(from, to)); |
- } |
- |
- virtual void Layout() { |
- SizeToPreferredSize(); |
- } |
private: |
+ void SetColor(SkColor from, SkColor to); |
+ |
DISALLOW_COPY_AND_ASSIGN(SplittedView); |
}; |