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

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

Issue 740203002: Fix download shelf visibility bug introduced by nullptr change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 // This can be called from the superclass destructor, when it destroys our 1208 // This can be called from the superclass destructor, when it destroys our
1209 // child views. At that point, browser_ is already gone. 1209 // child views. At that point, browser_ is already gone.
1210 if (!browser_) 1210 if (!browser_)
1211 return; 1211 return;
1212 1212
1213 if (visible && IsDownloadShelfVisible() != visible) { 1213 if (visible && IsDownloadShelfVisible() != visible) {
1214 // Invoke GetDownloadShelf to force the shelf to be created. 1214 // Invoke GetDownloadShelf to force the shelf to be created.
1215 GetDownloadShelf(); 1215 GetDownloadShelf();
1216 } 1216 }
1217 1217
1218 if (!browser_) 1218 browser_->UpdateDownloadShelfVisibility(visible);
1219 browser_->UpdateDownloadShelfVisibility(visible);
1220 1219
1221 // SetDownloadShelfVisible can force-close the shelf, so make sure we lay out 1220 // SetDownloadShelfVisible can force-close the shelf, so make sure we lay out
1222 // everything correctly, as if the animation had finished. This doesn't 1221 // everything correctly, as if the animation had finished. This doesn't
1223 // matter for showing the shelf, as the show animation will do it. 1222 // matter for showing the shelf, as the show animation will do it.
1224 ToolbarSizeChanged(false); 1223 ToolbarSizeChanged(false);
1225 } 1224 }
1226 1225
1227 bool BrowserView::IsDownloadShelfVisible() const { 1226 bool BrowserView::IsDownloadShelfVisible() const {
1228 return download_shelf_.get() && download_shelf_->IsShowing(); 1227 return download_shelf_.get() && download_shelf_->IsShowing();
1229 } 1228 }
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after
2505 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { 2504 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) {
2506 gfx::Point icon_bottom( 2505 gfx::Point icon_bottom(
2507 toolbar_->location_bar()->GetLocationBarAnchorPoint()); 2506 toolbar_->location_bar()->GetLocationBarAnchorPoint());
2508 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); 2507 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom);
2509 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); 2508 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr));
2510 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2509 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2511 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2510 top_arrow_height = infobar_top.y() - icon_bottom.y();
2512 } 2511 }
2513 return top_arrow_height; 2512 return top_arrow_height;
2514 } 2513 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698