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

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

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 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 | « ui/views/examples/double_split_view_example.cc ('k') | ui/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) 2012 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 UI_VIEWS_EXAMPLES_EXAMPLE_BASE_H_
6 #define UI_VIEWS_EXAMPLES_EXAMPLE_BASE_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "ui/views/examples/views_examples_export.h"
12
13 namespace views {
14 class View;
15
16 namespace examples {
17
18 class VIEWS_EXAMPLES_EXPORT ExampleBase {
19 public:
20 virtual ~ExampleBase();
21
22 // Sub-classes should creates and add the views to the given parent.
23 virtual void CreateExampleView(View* parent) = 0;
24
25 const std::string& example_title() const { return example_title_; }
26 View* example_view() { return container_; }
27
28 protected:
29 explicit ExampleBase(const char* title);
30
31 View* container() { return container_; }
32
33 // Prints a message in the status area, at the bottom of the window.
34 void PrintStatus(const char* format, ...);
35
36 // Converts an boolean value to "on" or "off".
37 const char* BoolToOnOff(bool value) {
38 return value ? "on" : "off";
39 }
40
41 private:
42 // Name of the example - used as title in the combobox list.
43 std::string example_title_;
44
45 // The view that contains the views example.
46 View* container_;
47
48 DISALLOW_COPY_AND_ASSIGN(ExampleBase);
49 };
50
51 } // namespace examples
52 } // namespace views
53
54 #endif // UI_VIEWS_EXAMPLES_EXAMPLE_BASE_H_
OLDNEW
« no previous file with comments | « ui/views/examples/double_split_view_example.cc ('k') | ui/views/examples/example_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698