1 // Copyright (c) 2013 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_TOP_VIEW_LAYOUT_VIEWS_H_
6 #define XWALK_RUNTIME_BROWSER_UI_TOP_VIEW_LAYOUT_VIEWS_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "ui/views/layout/layout_manager.h"
14 // Layout manager that handle a main content view taking all the space and
15 // optionally an top view. The top view will always get its preferred
16 // height. Used for implementing Tizen Indicator when running fullscreen.
18 // This layout expects that the view it is managing have either one or two
19 // children, and that the setter methods are called accordingly.
20 class TopViewLayout : public views::LayoutManager {
23 virtual ~TopViewLayout();
25 // Must be set to the content view, that will fill all the remaining available
26 // space in the layout. The |content_view| must be child of the view that this
28 void set_content_view(views::View* content_view) {
29 content_view_ = content_view;
32 // Optionally sets a top view, that will be positioned on the top and with its
33 // preferred height. The |top_view| must be children from the view that this
35 void set_top_view(views::View* top_view) { top_view_ = top_view; }
37 views::View* top_view() const { return top_view_; }
39 // Set or check if the top_view_ is in overlay mode. It means that in overlay
40 // mode the top_view_ will be over the content_view_.
41 void SetUseOverlay(bool enable);
42 bool IsUsingOverlay() const;
44 // views::LayoutManager implementation.
45 void Layout(views::View* host) override;
46 gfx::Size GetPreferredSize(const views::View* host) const override;
49 views::View* top_view_;
50 views::View* content_view_;
53 DISALLOW_COPY_AND_ASSIGN(TopViewLayout);
58 #endif // XWALK_RUNTIME_BROWSER_UI_TOP_VIEW_LAYOUT_VIEWS_H_