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/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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // In non-MD, the toolbar has a rounded corner that we don't want the tabstrip | 374 // In non-MD, the toolbar has a rounded corner that we don't want the tabstrip |
375 // to overlap. | 375 // to overlap. |
376 if (!md && !incognito_icon_ && delegate_->IsToolbarVisible()) | 376 if (!md && !incognito_icon_ && delegate_->IsToolbarVisible()) |
377 min_button_width += delegate_->GetToolbarLeadingCornerClientWidth(); | 377 min_button_width += delegate_->GetToolbarLeadingCornerClientWidth(); |
378 leading_button_start_ = std::max(leading_button_start_, min_button_width); | 378 leading_button_start_ = std::max(leading_button_start_, min_button_width); |
379 // The trailing corner is a mirror of the leading one. | 379 // The trailing corner is a mirror of the leading one. |
380 trailing_button_start_ = std::max(trailing_button_start_, min_button_width); | 380 trailing_button_start_ = std::max(trailing_button_start_, min_button_width); |
381 | 381 |
382 if (incognito_icon_) { | 382 if (incognito_icon_) { |
383 const gfx::Insets insets(GetLayoutInsets(AVATAR_ICON)); | 383 const gfx::Insets insets(GetLayoutInsets(AVATAR_ICON)); |
384 const gfx::Size size(delegate_->GetOTRAvatarIcon().size()); | 384 const gfx::Size size(delegate_->GetIncognitoAvatarIcon().size()); |
385 const int incognito_width = insets.left() + size.width(); | 385 const int incognito_width = insets.left() + size.width(); |
386 int x; | 386 int x; |
387 if (ShouldIncognitoIconBeOnRight()) { | 387 if (ShouldIncognitoIconBeOnRight()) { |
388 trailing_button_start_ += incognito_width; | 388 trailing_button_start_ += incognito_width; |
389 x = host->width() - trailing_button_start_; | 389 x = host->width() - trailing_button_start_; |
390 } else { | 390 } else { |
391 x = leading_button_start_ + insets.left(); | 391 x = leading_button_start_ + insets.left(); |
392 leading_button_start_ += incognito_width; | 392 leading_button_start_ += incognito_width; |
393 } | 393 } |
394 const int bottom = GetTabStripInsetsTop(false) + | 394 const int bottom = GetTabStripInsetsTop(false) + |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 | 613 |
614 void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host, | 614 void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host, |
615 views::View* view) { | 615 views::View* view) { |
616 SetView(view->id(), view); | 616 SetView(view->id(), view); |
617 } | 617 } |
618 | 618 |
619 void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host, | 619 void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host, |
620 views::View* view) { | 620 views::View* view) { |
621 SetView(view->id(), nullptr); | 621 SetView(view->id(), nullptr); |
622 } | 622 } |
OLD | NEW |