Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(756)

Side by Side Diff: chrome/renderer/webview_animating_overlay.h

Issue 10855151: Gradient overlay for constrained window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 CHROME_RENDERER_WEBVIEW_ANIMATING_OVERLAY_H_
6 #define CHROME_RENDERER_WEBVIEW_ANIMATING_OVERLAY_H_
7
8 #include "base/compiler_specific.h"
9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPageOverlay.h"
10 #include "ui/base/animation/animation_delegate.h"
11 #include "ui/base/animation/linear_animation.h"
12
13 namespace content {
14 class RenderView;
15 }
16
17 // This class draws a gradient on a PageOverlay of a WebView. The gradient
18 // fades in when shown and fades out when hidden.
19 class WebViewAnimatingOverlay : public WebKit::WebPageOverlay,
20 public ui::AnimationDelegate {
21 public:
22 enum State {
23 ANIMATING_IN,
24 VISIBLE,
25 ANIMATING_OUT,
26 HIDDEN
27 };
28
29 explicit WebViewAnimatingOverlay(content::RenderView* render_view);
30 virtual ~WebViewAnimatingOverlay();
31 void Show();
32 void Hide();
33
34 State state() { return state_; }
35
36 // WebKit::WebPageOverlay implementation:
37 virtual void paintPageOverlay(WebKit::WebCanvas* canvas) OVERRIDE;
38
39 // ui::AnimationDelegate implementation:
40 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
41 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
42
43 private:
44 int GetCurrentAlpha();
45
46 content::RenderView* render_view_;
47 State state_;
48 ui::LinearAnimation animation_;
49
50 DISALLOW_COPY_AND_ASSIGN(WebViewAnimatingOverlay);
51 };
52
53 #endif // CHROME_RENDERER_WEBVIEW_ANIMATING_OVERLAY_H_
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_render_view_observer.cc ('k') | chrome/renderer/webview_animating_overlay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698