| 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 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2134 if (devtools_window_ && !new_devtools_window && | 2134 if (devtools_window_ && !new_devtools_window && |
| 2135 devtools_focus_tracker_.get()) { | 2135 devtools_focus_tracker_.get()) { |
| 2136 devtools_focus_tracker_->FocusLastFocusedExternalView(); | 2136 devtools_focus_tracker_->FocusLastFocusedExternalView(); |
| 2137 devtools_focus_tracker_.reset(); | 2137 devtools_focus_tracker_.reset(); |
| 2138 } | 2138 } |
| 2139 | 2139 |
| 2140 devtools_window_ = new_devtools_window; | 2140 devtools_window_ = new_devtools_window; |
| 2141 if (devtools_window_) { | 2141 if (devtools_window_) { |
| 2142 devtools_web_view_->SetPreferredSize(devtools_window_->GetMinimumSize()); | 2142 devtools_web_view_->SetPreferredSize(devtools_window_->GetMinimumSize()); |
| 2143 devtools_web_view_->SetVisible(true); | 2143 devtools_web_view_->SetVisible(true); |
| 2144 GetContentsLayoutManager()->SetContentsViewInsets( | 2144 GetContentsLayoutManager()->SetContentsResizingStrategy( |
| 2145 devtools_window_->GetContentsInsets()); | 2145 devtools_window_->GetContentsResizingStrategy()); |
| 2146 } else { | 2146 } else { |
| 2147 devtools_web_view_->SetVisible(false); | 2147 devtools_web_view_->SetVisible(false); |
| 2148 GetContentsLayoutManager()->SetContentsViewInsets(gfx::Insets()); | 2148 GetContentsLayoutManager()->SetContentsResizingStrategy( |
| 2149 DevToolsContentsResizingStrategy()); |
| 2149 } | 2150 } |
| 2150 contents_container_->Layout(); | 2151 contents_container_->Layout(); |
| 2151 } | 2152 } |
| 2152 | 2153 |
| 2153 void BrowserView::UpdateUIForContents(WebContents* contents) { | 2154 void BrowserView::UpdateUIForContents(WebContents* contents) { |
| 2154 bool needs_layout = MaybeShowBookmarkBar(contents); | 2155 bool needs_layout = MaybeShowBookmarkBar(contents); |
| 2155 // TODO(jamescook): This function always returns true. Remove it and figure | 2156 // TODO(jamescook): This function always returns true. Remove it and figure |
| 2156 // out when layout is actually required. | 2157 // out when layout is actually required. |
| 2157 needs_layout |= MaybeShowInfoBar(contents); | 2158 needs_layout |= MaybeShowInfoBar(contents); |
| 2158 if (needs_layout) | 2159 if (needs_layout) |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2542 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2543 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
| 2543 gfx::Point icon_bottom( | 2544 gfx::Point icon_bottom( |
| 2544 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2545 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
| 2545 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2546 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
| 2546 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); | 2547 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); |
| 2547 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2548 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
| 2548 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2549 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
| 2549 } | 2550 } |
| 2550 return top_arrow_height; | 2551 return top_arrow_height; |
| 2551 } | 2552 } |
| OLD | NEW |