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.
5 #ifndef XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_H_
6 #define XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_H_
8 #include "base/files/file_path.h"
9 #include "content/public/browser/web_contents_observer.h"
10 #include "ui/compositor/layer_animation_observer.h"
27 class SplashScreen : public content::WebContentsObserver,
28 public ui::ImplicitAnimationObserver {
30 SplashScreen(views::Widget* host,
31 const base::FilePath& file,
32 content::WebContents* web_contents);
38 // Overridden from content::WebContentsObserver.
39 virtual void DidFinishLoad(int64 frame_id,
40 const GURL& validated_url,
42 content::RenderViewHost* render_view_host)
45 virtual void DidFailLoad(int64 frame_id,
46 const GURL& validated_url,
49 const base::string16& error_description,
50 content::RenderViewHost* render_view_host) OVERRIDE;
52 // ui::ImplicitAnimationObserver overrides:
53 virtual void OnImplicitAnimationsCompleted() OVERRIDE;
56 views::Widget* widget_host_;
57 base::FilePath splash_screen_image_;
59 scoped_ptr<ui::Layer> layer_;
60 class SplashScreenLayerDelegate;
61 scoped_ptr<SplashScreenLayerDelegate> layer_delegate_;
65 DISALLOW_COPY_AND_ASSIGN(SplashScreen);
70 #endif // XWALK_RUNTIME_BROWSER_UI_SPLASH_SCREEN_H_