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

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

Issue 1649493003: Speculative fix for crash during browser startup with opaque frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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 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/opaque_browser_frame_view_layout.h" 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "chrome/browser/profiles/profiles_state.h" 9 #include "chrome/browser/profiles/profiles_state.h"
10 #include "chrome/browser/ui/layout_constants.h" 10 #include "chrome/browser/ui/layout_constants.h"
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 void OpaqueBrowserFrameViewLayout::LayoutIncognitoIcon(views::View* host) { 380 void OpaqueBrowserFrameViewLayout::LayoutIncognitoIcon(views::View* host) {
381 const int old_button_size = leading_button_start_ + trailing_button_start_; 381 const int old_button_size = leading_button_start_ + trailing_button_start_;
382 382
383 // Any buttons/icon/title were laid out based on the frame border thickness, 383 // Any buttons/icon/title were laid out based on the frame border thickness,
384 // but the tabstrip bounds need to be based on the non-client border thickness 384 // but the tabstrip bounds need to be based on the non-client border thickness
385 // on any side where there aren't other buttons forcing a larger inset. 385 // on any side where there aren't other buttons forcing a larger inset.
386 const bool md = ui::MaterialDesignController::IsModeMaterial(); 386 const bool md = ui::MaterialDesignController::IsModeMaterial();
387 int min_button_width = NonClientBorderThickness(); 387 int min_button_width = NonClientBorderThickness();
388 // In non-MD, the toolbar has a rounded corner that we don't want the tabstrip 388 // In non-MD, the toolbar has a rounded corner that we don't want the tabstrip
389 // to overlap. 389 // to overlap.
390 if (!md && !avatar_button_) 390 if (!md && !avatar_button_ && delegate_->IsToolbarVisible())
391 min_button_width += delegate_->GetToolbarLeadingCornerClientWidth(); 391 min_button_width += delegate_->GetToolbarLeadingCornerClientWidth();
392 leading_button_start_ = std::max(leading_button_start_, min_button_width); 392 leading_button_start_ = std::max(leading_button_start_, min_button_width);
393 // The trailing corner is a mirror of the leading one. 393 // The trailing corner is a mirror of the leading one.
394 trailing_button_start_ = std::max(trailing_button_start_, min_button_width); 394 trailing_button_start_ = std::max(trailing_button_start_, min_button_width);
395 395
396 if (avatar_button_) { 396 if (avatar_button_) {
397 const gfx::Insets insets(GetLayoutInsets(AVATAR_ICON)); 397 const gfx::Insets insets(GetLayoutInsets(AVATAR_ICON));
398 const gfx::Size size(delegate_->GetOTRAvatarIcon().size()); 398 const gfx::Size size(delegate_->GetOTRAvatarIcon().size());
399 const int incognito_width = insets.left() + size.width(); 399 const int incognito_width = insets.left() + size.width();
400 int x; 400 int x;
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 631
632 void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host, 632 void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host,
633 views::View* view) { 633 views::View* view) {
634 SetView(view->id(), view); 634 SetView(view->id(), view);
635 } 635 }
636 636
637 void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host, 637 void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host,
638 views::View* view) { 638 views::View* view) {
639 SetView(view->id(), nullptr); 639 SetView(view->id(), nullptr);
640 } 640 }
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