forked from nwjs/nw.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrowser_view_layout.h
49 lines (37 loc) · 1.49 KB
/
browser_view_layout.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NW_BROWSER_VIEW_LAYOUT_H_
#define NW_BROWSER_VIEW_LAYOUT_H_
#include "base/compiler_specific.h"
#include "ui/views/layout/layout_manager.h"
#include "ui/views/view.h"
namespace nw {
///////////////////////////////////////////////////////////////////////////////
//
// copied from ui/views/layout/FillLayout
//
///////////////////////////////////////////////////////////////////////////////
class BrowserViewLayout : public views::LayoutManager {
public:
BrowserViewLayout();
~BrowserViewLayout() override;
// Overridden from LayoutManager:
void Layout(views::View* host) override;
gfx::Size GetPreferredSize(const views::View* host) const override;
int GetPreferredHeightForWidth(const views::View* host,
int width) const override;
void set_menu_bar(views::View* menu_bar) { menu_bar_ = menu_bar; }
views::View* menu_bar() { return menu_bar_; }
void set_web_view(views::View* web_view) { web_view_ = web_view; }
views::View* web_view() { return web_view_; }
void set_tool_bar(views::View* tool_bar) { tool_bar_ = tool_bar; }
views::View* tool_bar() { return tool_bar_; }
private:
views::View* menu_bar_;
views::View* web_view_;
views::View* tool_bar_;
DISALLOW_COPY_AND_ASSIGN(BrowserViewLayout);
};
} // namespace nw
#endif // NW_BROWSER_VIEW_LAYOUT_H_