Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: chrome/browser/ui/views/frame/contents_container.cc

Issue 63173016: DevTools: place DevTools WebContents underneath inspected WebContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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 #include "chrome/browser/ui/views/frame/contents_container.h"
6
7 ContentsContainer::ContentsContainer(views::View* active_web_view)
8 : active_web_view_(active_web_view),
9 active_top_margin_(0) {
10 AddChildView(active_web_view_);
11 }
12
13 ContentsContainer::~ContentsContainer() {
14 }
15
16 bool ContentsContainer::SetActiveTopMargin(int margin) {
17 if (active_top_margin_ == margin)
18 return false;
19
20 active_top_margin_ = margin;
21 // Make sure we layout next time around. We need this in case our bounds
22 // haven't changed.
23 InvalidateLayout();
24 return true;
25 }
26
27 void ContentsContainer::Layout() {
28 int content_y = active_top_margin_;
29 int content_height = std::max(0, height() - content_y);
30
31 active_web_view_->SetBounds(0, content_y, width(), content_height);
32
33 // Need to invoke views::View in case any views whose bounds didn't change
34 // still need a layout.
35 views::View::Layout();
36 }
37
38 const char* ContentsContainer::GetClassName() const {
39 return "ContentsContainer";
40 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/contents_container.h ('k') | chrome/browser/ui/views/frame/contents_layout_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698