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

Side by Side Diff: views/examples/example_base.h

Issue 8555013: views: Move examples/ directory to ui/views/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « views/examples/double_split_view_example.cc ('k') | views/examples/example_base.cc » ('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 #ifndef VIEWS_EXAMPLES_EXAMPLE_BASE_H_
6 #define VIEWS_EXAMPLES_EXAMPLE_BASE_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/basictypes.h"
12
13 namespace views {
14 class View;
15 }
16
17 namespace examples {
18
19 class ExamplesMain;
20
21 class ExampleBase {
22 public:
23 virtual ~ExampleBase();
24
25 // Sub-classes should creates and add the views to the given parent.
26 virtual void CreateExampleView(views::View* parent) = 0;
27
28 const std::string& example_title() const { return example_title_; }
29
30 // This view is added as a tab to the example application.
31 views::View* example_view() { return container_; }
32
33 protected:
34 ExampleBase(ExamplesMain* main, const char* title);
35
36 // Prints a message in the status area, at the bottom of the window.
37 void PrintStatus(const char* format, ...);
38
39 // Converts an boolean value to "on" or "off".
40 const char* BoolToOnOff(bool value) {
41 return value ? "on" : "off";
42 }
43
44 private:
45 // The runner actually running this example.
46 ExamplesMain* main_;
47
48 // Name of the example - used for the title of the tab.
49 std::string example_title_;
50
51 // The view containing example views.
52 views::View* container_;
53
54 DISALLOW_COPY_AND_ASSIGN(ExampleBase);
55 };
56
57 } // namespace examples
58
59 #endif // VIEWS_EXAMPLES_EXAMPLE_BASE_H_
OLDNEW
« no previous file with comments | « views/examples/double_split_view_example.cc ('k') | views/examples/example_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698