Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / ios / web / public / app / web_main.h
blobb5d651cd6686eb41e8e29319c198ff2962dbe9aa
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.
5 #ifndef IOS_WEB_PUBLIC_APP_WEB_MAIN_H_
6 #define IOS_WEB_PUBLIC_APP_WEB_MAIN_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ios/web/public/app/web_main_delegate.h"
11 namespace web {
12 class WebMainRunner;
14 // Contains parameters passed to WebMain.
15 struct WebMainParams {
16 explicit WebMainParams(WebMainDelegate* delegate) : delegate(delegate) {}
18 WebMainDelegate* delegate;
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.
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();
33 private:
34 scoped_ptr<WebMainRunner> web_main_runner_;
37 } // namespace web
39 #endif // IOS_WEB_PUBLIC_APP_WEB_MAIN_H_