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 IOS_WEB_PUBLIC_APP_WEB_MAIN_H_ |
| 6 #define IOS_WEB_PUBLIC_APP_WEB_MAIN_H_ |
| 7 |
| 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "ios/web/public/app/web_main_delegate.h" |
| 10 |
| 11 namespace web { |
| 12 class WebMainRunner; |
| 13 |
| 14 // Contains parameters passed to WebMain. |
| 15 struct WebMainParams { |
| 16 explicit WebMainParams(WebMainDelegate* delegate) : delegate(delegate) {} |
| 17 |
| 18 WebMainDelegate* delegate; |
| 19 }; |
| 20 |
| 21 // Encapsulates any setup and initialization that is needed by common |
| 22 // web/ code. A single instance of this object should be created during app |
| 23 // startup (or shortly after launch), and clients must ensure that this object |
| 24 // is not destroyed while web/ code is still on the stack. |
| 25 // |
| 26 // Clients can add custom code to the startup flow by implementing the methods |
| 27 // in WebMainDelegate and WebMainParts. |
| 28 class WebMain { |
| 29 public: |
| 30 explicit WebMain(const WebMainParams& params); |
| 31 ~WebMain(); |
| 32 |
| 33 private: |
| 34 scoped_ptr<WebMainRunner> web_main_runner_; |
| 35 }; |
| 36 |
| 37 } // namespace web |
| 38 |
| 39 #endif // IOS_WEB_PUBLIC_APP_WEB_MAIN_H_ |
OLD | NEW |