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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « views/examples/single_split_view_example.h ('k') | views/views.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "views/examples/single_split_view_example.h"
6
7 namespace examples {
8
9 SingleSplitViewExample::SingleSplitViewExample(ExamplesMain* main)
10 : ExampleBase(main) {
11 }
12
13 SingleSplitViewExample::~SingleSplitViewExample() {
14 }
15
16 std::wstring SingleSplitViewExample::GetExampleTitle() {
17 return L"Single Split View";
18 }
19
20 void SingleSplitViewExample::CreateExampleView(views::View* container) {
21 SplittedView* splitted_view_1 = new SplittedView();
22 SplittedView* splitted_view_2 = new SplittedView();
23
24 single_split_view_ = new views::SingleSplitView(
25 splitted_view_1, splitted_view_2,
26 views::SingleSplitView::HORIZONTAL_SPLIT,
27 NULL);
28
29 splitted_view_1->SetColor(SK_ColorYELLOW, SK_ColorCYAN);
30
31 views::GridLayout* layout = new views::GridLayout(container);
32 container->SetLayoutManager(layout);
33
34 // Add scroll view.
35 views::ColumnSet* column_set = layout->AddColumnSet(0);
36 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1,
37 views::GridLayout::USE_PREF, 0, 0);
38 layout->StartRow(1, 0);
39 layout->AddView(single_split_view_);
40 }
41
42 SingleSplitViewExample::SplittedView::SplittedView() {
43 SetColor(SK_ColorRED, SK_ColorGREEN)_;
44 }
45
46 SingleSplitViewExample::SplittedView::~SplittedView() {
47 }
48
49 gfx::Size SingleSplitViewExample::SplittedView::GetPreferredSize() {
50 return gfx::Size(width(), height());
51 }
52
53 gfx::Size SingleSplitViewExample::SplittedView::GetMinimumSize() {
54 return gfx::Size(10, 10);
55 }
56
57 void SingleSplitViewExample::SplittedView::Layout() {
58 SizeToPreferredSize();
59 }
60
61 void SingleSplitViewExample::SplittedView::SetColor(SkColor from, SkColor to) {
62 set_background(
63 views::Background::CreateVerticalGradientBackground(from, to));
64 }
65
66 } // namespace examples
OLDNEW
« 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