Home | History | Annotate | Download | only in frame
      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.
      4 
      5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
      6 #define CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
      7 
      8 #include <string>
      9 
     10 #include "base/basictypes.h"
     11 #include "base/compiler_specific.h"
     12 #include "ui/views/view.h"
     13 
     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 {
     17  public:
     18   explicit ContentsContainer(views::View* active_web_view);
     19   virtual ~ContentsContainer();
     20 
     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);
     26 
     27   // Overridden from views::View:
     28   virtual void Layout() OVERRIDE;
     29   virtual const char* GetClassName() const OVERRIDE;
     30 
     31  private:
     32   views::View* active_web_view_;
     33 
     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_;
     37 
     38   DISALLOW_COPY_AND_ASSIGN(ContentsContainer);
     39 };
     40 
     41 #endif  // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_CONTAINER_H_
     42