OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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_APP_LIST_VIEWS_VIEWS_DEMO_APP_H_ |
| 6 #define UI_APP_LIST_VIEWS_VIEWS_DEMO_APP_H_ |
| 7 |
| 8 #include "base/callback_forward.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/run_loop.h" |
| 12 |
| 13 class ViewsDemoAppDelegate { |
| 14 public: |
| 15 ViewsDemoAppDelegate(); |
| 16 virtual ~ViewsDemoAppDelegate(); |
| 17 |
| 18 virtual void Init(); |
| 19 void Run(); |
| 20 |
| 21 protected: |
| 22 base::RunLoop* run_loop() { return run_loop_.get(); } |
| 23 |
| 24 private: |
| 25 scoped_ptr<base::RunLoop> run_loop_; |
| 26 }; |
| 27 |
| 28 class ViewsDemoApp { |
| 29 public: |
| 30 static scoped_ptr<ViewsDemoApp> Create( |
| 31 scoped_ptr<ViewsDemoAppDelegate> delegate); |
| 32 static int RunSubProcess(int argc, char** argv); |
| 33 |
| 34 virtual ~ViewsDemoApp(); |
| 35 |
| 36 virtual void Run() = 0; |
| 37 virtual void AddOption(const char* description, |
| 38 const base::Callback<void(bool)>& callback, |
| 39 bool initial_state); |
| 40 |
| 41 void InitOnMainThread(); |
| 42 |
| 43 protected: |
| 44 ViewsDemoApp(); |
| 45 |
| 46 private: |
| 47 class Impl; |
| 48 |
| 49 scoped_ptr<Impl> impl_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(ViewsDemoApp); |
| 52 }; |
| 53 |
| 54 #endif // UI_APP_LIST_VIEWS_VIEWS_DEMO_APP_H_ |
OLD | NEW |