1 // Copyright 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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "ui/views/view.h"
14 // ContentsContainer is responsible for managing the active WebContents view.
15 // ContentsContainer has one child: the currently active WebContents.
16 class ContentsContainer : public views::View {
18 explicit ContentsContainer(views::View* active_web_view);
19 virtual ~ContentsContainer();
21 // Sets the active top margin; the active WebView's y origin would be
22 // positioned at this |margin|, causing the active WebView to be pushed down
23 // vertically by |margin| pixels in the |ContentsContainer|. Returns true
24 // if the margin changed and this view needs Layout().
25 bool SetActiveTopMargin(int margin);
27 // Overridden from views::View:
28 virtual void Layout() OVERRIDE;
29 virtual const char* GetClassName() const OVERRIDE;
32 views::View* active_web_view_;
34 // The margin between the top and the active view. This is used to make the
35 // find bar overlap the detached bookmark bar on the new tab page.
36 int active_top_margin_;
38 DISALLOW_COPY_AND_ASSIGN(ContentsContainer);
41 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_