Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 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_LAYOUT_MANAGER_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_LAYOUT_MANAGER_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/compiler_specific.h" | |
| 10 #include "ui/gfx/size.h" | |
| 11 #include "ui/views/layout/layout_manager.h" | |
| 12 | |
| 13 // ContainerLayoutManager is managing WebContents atop of the DevTools. | |
|
sky
2013/12/06 17:25:44
ContentsLayoutManager positions the WebContents an
dgozman
2013/12/09 13:19:18
Done.
| |
| 14 // It also supports the | |
| 15 class ContentsLayoutManager : public views::LayoutManager { | |
| 16 public: | |
| 17 ContentsLayoutManager(views::View* devtools_view, views::View* contents_view); | |
| 18 virtual ~ContentsLayoutManager(); | |
| 19 | |
| 20 // Sets the active top margin; both devtools_view and contents_view will be | |
| 21 // pushed down vertically by |margin|. Returns true if the margin has changed | |
| 22 // and InvalidateLayout() is necessary. | |
| 23 bool SetActiveTopMargin(int margin); | |
| 24 | |
| 25 // Sets the contents offsets from the sides. Returns true if offsets have | |
| 26 // changed and InvalidateLayout() is necessary. | |
| 27 bool SetContentsViewOffsets( | |
|
sky
2013/12/06 17:25:44
This can InvalidateLayout is you need it to? The V
dgozman
2013/12/09 13:19:18
Done.
| |
| 28 const gfx::Size& top_left, const gfx::Size& bottom_right); | |
|
sky
2013/12/06 17:25:44
How come this is two sizes? Isn't an Insets what y
dgozman
2013/12/09 13:19:18
Missed that class. Thank you! Done.
| |
| 29 | |
| 30 // views::LayoutManager overrides: | |
| 31 virtual void Layout(views::View* host) OVERRIDE; | |
| 32 virtual gfx::Size GetPreferredSize(views::View* host) OVERRIDE; | |
| 33 | |
| 34 private: | |
| 35 views::View* devtools_view_; | |
| 36 views::View* contents_view_; | |
| 37 | |
| 38 gfx::Size top_left_; | |
| 39 gfx::Size bottom_right_; | |
| 40 int active_top_margin_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(ContentsLayoutManager); | |
| 43 }; | |
| 44 | |
| 45 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_CONTENTS_LAYOUT_MANAGER_H_ | |
| OLD | NEW |