| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" | 5 #include "chrome/browser/ui/views/frame/contents_layout_manager.h" |
| 6 | 6 |
| 7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
| 8 | 8 |
| 9 ContentsLayoutManager::ContentsLayoutManager( | 9 ContentsLayoutManager::ContentsLayoutManager( |
| 10 views::View* devtools_view, | 10 views::View* devtools_view, |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 gfx::Rect new_devtools_bounds; | 48 gfx::Rect new_devtools_bounds; |
| 49 gfx::Rect new_contents_bounds; | 49 gfx::Rect new_contents_bounds; |
| 50 | 50 |
| 51 ApplyDevToolsContentsResizingStrategy(strategy_, container_size, | 51 ApplyDevToolsContentsResizingStrategy(strategy_, container_size, |
| 52 &new_devtools_bounds, &new_contents_bounds); | 52 &new_devtools_bounds, &new_contents_bounds); |
| 53 new_devtools_bounds.Offset(0, top); | 53 new_devtools_bounds.Offset(0, top); |
| 54 new_contents_bounds.Offset(0, top); | 54 new_contents_bounds.Offset(0, top); |
| 55 | 55 |
| 56 // DevTools cares about the specific position, so we have to compensate RTL | 56 // DevTools cares about the specific position, so we have to compensate RTL |
| 57 // layout here. | 57 // layout here. |
| 58 new_devtools_bounds.set_x(host_->GetMirroredXForRect(new_devtools_bounds)); | 58 devtools_view_->SetBoundsRect(host_->GetMirroredRect(new_devtools_bounds)); |
| 59 new_contents_bounds.set_x(host_->GetMirroredXForRect(new_contents_bounds)); | 59 contents_view_->SetBoundsRect(host_->GetMirroredRect(new_contents_bounds)); |
| 60 | |
| 61 devtools_view_->SetBoundsRect(new_devtools_bounds); | |
| 62 contents_view_->SetBoundsRect(new_contents_bounds); | |
| 63 } | 60 } |
| 64 | 61 |
| 65 gfx::Size ContentsLayoutManager::GetPreferredSize( | 62 gfx::Size ContentsLayoutManager::GetPreferredSize( |
| 66 const views::View* host) const { | 63 const views::View* host) const { |
| 67 return gfx::Size(); | 64 return gfx::Size(); |
| 68 } | 65 } |
| 69 | 66 |
| 70 void ContentsLayoutManager::Installed(views::View* host) { | 67 void ContentsLayoutManager::Installed(views::View* host) { |
| 71 DCHECK(!host_); | 68 DCHECK(!host_); |
| 72 host_ = host; | 69 host_ = host; |
| 73 } | 70 } |
| OLD | NEW |