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

Unified Diff: chrome/browser/ui/views/frame/contents_container.h

Issue 4932001: Makes the current page dim out when transitioning to instant preview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/frame/contents_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/frame/contents_container.h
diff --git a/chrome/browser/ui/views/frame/contents_container.h b/chrome/browser/ui/views/frame/contents_container.h
index 8943f0a66e58466c1bcab1e825ec7387eb64a819..9f25c6b0a7eb1634dda463af4bfef8db645a3792 100644
--- a/chrome/browser/ui/views/frame/contents_container.h
+++ b/chrome/browser/ui/views/frame/contents_container.h
@@ -6,14 +6,21 @@
#define CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
#pragma once
+#include "app/animation.h"
+#include "base/scoped_ptr.h"
#include "views/view.h"
+class SlideAnimation;
class TabContents;
+namespace views {
+class Widget;
+}
+
// ContentsContainer is responsible for managing the TabContents views.
// ContentsContainer has up to two children: one for the currently active
// TabContents and one for instant's TabContents.
-class ContentsContainer : public views::View {
+class ContentsContainer : public views::View, public AnimationDelegate {
public:
explicit ContentsContainer(views::View* active);
virtual ~ContentsContainer();
@@ -35,9 +42,18 @@ class ContentsContainer : public views::View {
// retuns the bounds the preview would be shown at.
gfx::Rect GetPreviewBounds();
+ // Fades out the active contents.
+ void FadeActiveContents();
+
+ // Removes the fade. This is done implicitly when the preview is made active.
+ void RemoveFade();
+
// View overrides:
virtual void Layout();
+ // AnimationDelegate overrides:
+ virtual void AnimationProgressed(const Animation* animation);
+
private:
views::View* active_;
@@ -45,6 +61,13 @@ class ContentsContainer : public views::View {
TabContents* preview_tab_contents_;
+ // Translucent Widget positioned right above the active view that is used to
+ // make the active view appear faded out.
+ views::Widget* active_overlay_;
+
+ // Animation used to vary the opacity of active_overlay.
+ scoped_ptr<SlideAnimation> overlay_animation_;
+
// The margin between the top and the active view. This is used to make the
// preview overlap the bookmark bar on the new tab page.
int active_top_margin_;
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/frame/contents_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698