| OLD | NEW |
| (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_MAIN_H_ | |
| 6 #define VIEWS_EXAMPLES_EXAMPLE_MAIN_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 #include <vector> | |
| 11 | |
| 12 #include "base/basictypes.h" | |
| 13 #include "base/compiler_specific.h" | |
| 14 #include "views/widget/widget_delegate.h" | |
| 15 | |
| 16 namespace views { | |
| 17 class Label; | |
| 18 class TabbedPane; | |
| 19 class View; | |
| 20 } // namespace views | |
| 21 | |
| 22 namespace examples { | |
| 23 class ExampleBase; | |
| 24 | |
| 25 // ExamplesMain creates all view examples. | |
| 26 class ExamplesMain : public views::WidgetDelegate { | |
| 27 public: | |
| 28 ExamplesMain(); | |
| 29 virtual ~ExamplesMain(); | |
| 30 | |
| 31 // Creates all the examples and shows the window. | |
| 32 void Init(); | |
| 33 | |
| 34 // Prints a message in the status area, at the bottom of the window. | |
| 35 void SetStatus(const std::string& status); | |
| 36 | |
| 37 private: | |
| 38 // Adds a new example to the tabbed window. | |
| 39 void AddExample(ExampleBase* example); | |
| 40 | |
| 41 // views::WidgetDelegate implementation: | |
| 42 virtual bool CanResize() const OVERRIDE; | |
| 43 virtual bool CanMaximize() const OVERRIDE; | |
| 44 virtual string16 GetWindowTitle() const OVERRIDE; | |
| 45 virtual views::View* GetContentsView() OVERRIDE; | |
| 46 virtual void WindowClosing() OVERRIDE; | |
| 47 virtual views::Widget* GetWidget() OVERRIDE; | |
| 48 virtual const views::Widget* GetWidget() const OVERRIDE; | |
| 49 | |
| 50 views::TabbedPane* tabbed_pane_; | |
| 51 views::View* contents_; | |
| 52 views::Label* status_label_; | |
| 53 std::vector<ExampleBase*> examples_; | |
| 54 | |
| 55 DISALLOW_COPY_AND_ASSIGN(ExamplesMain); | |
| 56 }; | |
| 57 | |
| 58 } // namespace examples | |
| 59 | |
| 60 #endif // VIEWS_EXAMPLES_EXAMPLE_MAIN_H_ | |
| OLD | NEW |