Upstream version 11.39.252.0
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / runtime_defered_ui_strategy.h
1 // Copyright (c) 2014 Intel Corporation. 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 XWALK_RUNTIME_BROWSER_RUNTIME_DEFERED_UI_STRATEGY_H_
6 #define XWALK_RUNTIME_BROWSER_RUNTIME_DEFERED_UI_STRATEGY_H_
7
8 #include <map>
9
10 #include "xwalk/runtime/browser/runtime_ui_strategy.h"
11 #include "xwalk/runtime/browser/ui/native_app_window.h"
12
13 namespace xwalk {
14 class Runtime;
15
16 class RuntimeDeferedUIStrategy : public RuntimeUIStrategy {
17  public:
18   RuntimeDeferedUIStrategy();
19   virtual ~RuntimeDeferedUIStrategy();
20
21   // Override from RuntimeUIStrategy.
22   virtual void Show(Runtime* runtime,
23                     const NativeAppWindow::CreateParams& params) OVERRIDE;
24
25   void ShowStoredRuntimes();
26
27  private:
28   std::map<Runtime*, NativeAppWindow::CreateParams> runtime_map_;
29   bool defered_show_;
30 };
31
32 inline RuntimeDeferedUIStrategy*
33 ToRuntimeDeferedUIStrategy(RuntimeUIStrategy* ui_strategy) {
34   return static_cast<RuntimeDeferedUIStrategy*>(ui_strategy);
35 }
36 }  // namespace xwalk
37 #endif  // XWALK_RUNTIME_BROWSER_RUNTIME_DEFERED_UI_STRATEGY_H_