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

Side by Side Diff: ui/views/examples/double_split_view_example.cc

Issue 8687013: Get the examples to run in aura_shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/examples/double_split_view_example.h ('k') | ui/views/examples/example_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/examples/double_split_view_example.h" 5 #include "ui/views/examples/double_split_view_example.h"
6 6
7 #include "ui/views/layout/grid_layout.h" 7 #include "ui/views/layout/grid_layout.h"
8 #include "views/controls/single_split_view.h" 8 #include "views/controls/single_split_view.h"
9 9
10 namespace { 10 namespace {
(...skipping 24 matching lines...) Expand all
35 set_background( 35 set_background(
36 views::Background::CreateVerticalGradientBackground(from, to)); 36 views::Background::CreateVerticalGradientBackground(from, to));
37 } 37 }
38 38
39 gfx::Size SplittedView::GetMinimumSize() { 39 gfx::Size SplittedView::GetMinimumSize() {
40 return gfx::Size(10, 10); 40 return gfx::Size(10, 10);
41 } 41 }
42 42
43 } // namespace 43 } // namespace
44 44
45 namespace views {
45 namespace examples { 46 namespace examples {
46 47
47 DoubleSplitViewExample::DoubleSplitViewExample(ExamplesMain* main) 48 DoubleSplitViewExample::DoubleSplitViewExample()
48 : ExampleBase(main, "Double Split View") { 49 : ExampleBase("Double Split View") {
49 } 50 }
50 51
51 DoubleSplitViewExample::~DoubleSplitViewExample() { 52 DoubleSplitViewExample::~DoubleSplitViewExample() {
52 } 53 }
53 54
54 void DoubleSplitViewExample::CreateExampleView(views::View* container) { 55 void DoubleSplitViewExample::CreateExampleView(View* container) {
55 SplittedView* splitted_view_1 = new SplittedView(); 56 SplittedView* splitted_view_1 = new SplittedView();
56 SplittedView* splitted_view_2 = new SplittedView(); 57 SplittedView* splitted_view_2 = new SplittedView();
57 SplittedView* splitted_view_3 = new SplittedView(); 58 SplittedView* splitted_view_3 = new SplittedView();
58 59
59 inner_single_split_view_ = new views::SingleSplitView( 60 inner_single_split_view_ = new SingleSplitView(
60 splitted_view_1, splitted_view_2, 61 splitted_view_1, splitted_view_2,
61 views::SingleSplitView::HORIZONTAL_SPLIT, 62 SingleSplitView::HORIZONTAL_SPLIT,
62 NULL); 63 NULL);
63 64
64 outer_single_split_view_ = new views::SingleSplitView( 65 outer_single_split_view_ = new SingleSplitView(
65 inner_single_split_view_, splitted_view_3, 66 inner_single_split_view_, splitted_view_3,
66 views::SingleSplitView::HORIZONTAL_SPLIT, 67 SingleSplitView::HORIZONTAL_SPLIT,
67 NULL); 68 NULL);
68 69
69 views::GridLayout* layout = new views::GridLayout(container); 70 GridLayout* layout = new GridLayout(container);
70 container->SetLayoutManager(layout); 71 container->SetLayoutManager(layout);
71 72
72 // Add scroll view. 73 // Add scroll view.
73 views::ColumnSet* column_set = layout->AddColumnSet(0); 74 ColumnSet* column_set = layout->AddColumnSet(0);
74 column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, 75 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1,
75 views::GridLayout::USE_PREF, 0, 0); 76 GridLayout::USE_PREF, 0, 0);
76 layout->StartRow(1, 0); 77 layout->StartRow(1, 0);
77 layout->AddView(outer_single_split_view_); 78 layout->AddView(outer_single_split_view_);
78 } 79 }
79 80
80 } // namespace examples 81 } // namespace examples
82 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/double_split_view_example.h ('k') | ui/views/examples/example_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698