| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 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 | 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/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2130 if (devtools_window_ && !new_devtools_window && | 2130 if (devtools_window_ && !new_devtools_window && |
| 2131 devtools_focus_tracker_.get()) { | 2131 devtools_focus_tracker_.get()) { |
| 2132 devtools_focus_tracker_->FocusLastFocusedExternalView(); | 2132 devtools_focus_tracker_->FocusLastFocusedExternalView(); |
| 2133 devtools_focus_tracker_.reset(); | 2133 devtools_focus_tracker_.reset(); |
| 2134 } | 2134 } |
| 2135 | 2135 |
| 2136 devtools_window_ = new_devtools_window; | 2136 devtools_window_ = new_devtools_window; |
| 2137 if (devtools_window_) { | 2137 if (devtools_window_) { |
| 2138 devtools_web_view_->SetPreferredSize(devtools_window_->GetMinimumSize()); | 2138 devtools_web_view_->SetPreferredSize(devtools_window_->GetMinimumSize()); |
| 2139 devtools_web_view_->SetVisible(true); | 2139 devtools_web_view_->SetVisible(true); |
| 2140 GetContentsLayoutManager()->SetContentsViewInsets( | 2140 GetContentsLayoutManager()->SetContentsResizingStrategy( |
| 2141 devtools_window_->GetContentsInsets()); | 2141 devtools_window_->GetContentsResizingStrategy()); |
| 2142 } else { | 2142 } else { |
| 2143 devtools_web_view_->SetVisible(false); | 2143 devtools_web_view_->SetVisible(false); |
| 2144 GetContentsLayoutManager()->SetContentsViewInsets(gfx::Insets()); | 2144 GetContentsLayoutManager()->SetContentsResizingStrategy( |
| 2145 DevToolsContentsResizingStrategy()); |
| 2145 } | 2146 } |
| 2146 contents_container_->Layout(); | 2147 contents_container_->Layout(); |
| 2147 } | 2148 } |
| 2148 | 2149 |
| 2149 void BrowserView::UpdateUIForContents(WebContents* contents) { | 2150 void BrowserView::UpdateUIForContents(WebContents* contents) { |
| 2150 bool needs_layout = MaybeShowBookmarkBar(contents); | 2151 bool needs_layout = MaybeShowBookmarkBar(contents); |
| 2151 // TODO(jamescook): This function always returns true. Remove it and figure | 2152 // TODO(jamescook): This function always returns true. Remove it and figure |
| 2152 // out when layout is actually required. | 2153 // out when layout is actually required. |
| 2153 needs_layout |= MaybeShowInfoBar(contents); | 2154 needs_layout |= MaybeShowInfoBar(contents); |
| 2154 if (needs_layout) | 2155 if (needs_layout) |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2538 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2539 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2539 gfx::Point icon_bottom( | 2540 gfx::Point icon_bottom( |
| 2540 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2541 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2541 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2542 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2542 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2543 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2543 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2544 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2544 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2545 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2545 } | 2546 } |
| 2546 return top_arrow_height; | 2547 return top_arrow_height; |
| 2547 } | 2548 } |
| OLD | NEW |