fea8be8bba32d71b3abc2bd8b66ad28ae9f49638
[platform/framework/web/crosswalk.git] / src / xwalk / runtime / browser / ui / splash_screen_tizen.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_UI_SPLASH_SCREEN_TIZEN_H_
6 #define XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_TIZEN_H_
7
8 #include "base/files/file_path.h"
9 #include "content/public/browser/web_contents_observer.h"
10 #include "ui/compositor/layer_animation_observer.h"
11
12 namespace content {
13 class WebContents;
14 class RenderViewHost;
15 }
16
17 namespace ui {
18 class Layer;
19 }
20
21 namespace views {
22 class Widget;
23 }
24
25 namespace xwalk {
26
27 class SplashScreenTizen : public content::WebContentsObserver,
28                           public ui::ImplicitAnimationObserver {
29  public:
30   SplashScreenTizen(views::Widget* host,
31                     const base::FilePath& file,
32                     content::WebContents* web_contents);
33   ~SplashScreenTizen();
34
35   void Start();
36   void Stop();
37
38   // Overridden from content::WebContentsObserver.
39   void DidFinishLoad(content::RenderFrameHost* render_frame_host,
40                      const GURL& validated_url) override;
41
42   void DidFailLoad(content::RenderFrameHost* render_frame_host,
43                    const GURL& validated_url,
44                    int error_code,
45                    const base::string16& error_description) override;
46
47
48   // ui::ImplicitAnimationObserver overrides:
49   void OnImplicitAnimationsCompleted() override;
50
51  private:
52   views::Widget* widget_host_;
53   base::FilePath splash_screen_image_;
54
55   scoped_ptr<ui::Layer> layer_;
56   class SplashScreenLayerDelegate;
57   scoped_ptr<SplashScreenLayerDelegate> layer_delegate_;
58
59   bool is_started;
60
61   DISALLOW_COPY_AND_ASSIGN(SplashScreenTizen);
62 };
63
64 }  // namespace xwalk
65
66 #endif  // XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_TIZEN_H_