| 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 "chrome/browser/profiles/profiles_state.h" | 8 #include "chrome/browser/profiles/profiles_state.h" |
| 9 #include "chrome/browser/ui/layout_constants.h" | 9 #include "chrome/browser/ui/layout_constants.h" |
| 10 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" | 10 #include "chrome/browser/ui/views/profiles/avatar_menu_button.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 host->width() - trailing_button_start_ - button_width_with_offset; | 408 host->width() - trailing_button_start_ - button_width_with_offset; |
| 409 int button_y = CaptionButtonY(!IsTitleBarCondensed()); | 409 int button_y = CaptionButtonY(!IsTitleBarCondensed()); |
| 410 | 410 |
| 411 minimum_size_for_buttons_ += button_width_with_offset; | 411 minimum_size_for_buttons_ += button_width_with_offset; |
| 412 trailing_button_start_ += button_width_with_offset; | 412 trailing_button_start_ += button_width_with_offset; |
| 413 | 413 |
| 414 // In non-maximized mode, allow the new tab button to completely slide under | 414 // In non-maximized mode, allow the new tab button to completely slide under |
| 415 // the avatar button. | 415 // the avatar button. |
| 416 if (!IsTitleBarCondensed()) { | 416 if (!IsTitleBarCondensed()) { |
| 417 trailing_button_start_ -= | 417 trailing_button_start_ -= |
| 418 GetLayoutConstant(NEW_TAB_BUTTON_WIDTH) + kNewTabCaptionNormalSpacing; | 418 GetLayoutSize(NEW_TAB_BUTTON).width() + kNewTabCaptionNormalSpacing; |
| 419 } | 419 } |
| 420 | 420 |
| 421 new_avatar_button_->SetBounds(button_x, button_y, button_width, | 421 new_avatar_button_->SetBounds(button_x, button_y, button_width, |
| 422 kCaptionButtonHeight); | 422 kCaptionButtonHeight); |
| 423 } | 423 } |
| 424 | 424 |
| 425 void OpaqueBrowserFrameViewLayout::LayoutAvatar(views::View* host) { | 425 void OpaqueBrowserFrameViewLayout::LayoutAvatar(views::View* host) { |
| 426 // Even though the avatar is used for both incognito and profiles we always | 426 // Even though the avatar is used for both incognito and profiles we always |
| 427 // use the incognito icon to layout the avatar button. The profile icon | 427 // use the incognito icon to layout the avatar button. The profile icon |
| 428 // can be customized so we can't depend on its size to perform layout. | 428 // can be customized so we can't depend on its size to perform layout. |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 | 713 |
| 714 void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host, | 714 void OpaqueBrowserFrameViewLayout::ViewAdded(views::View* host, |
| 715 views::View* view) { | 715 views::View* view) { |
| 716 SetView(view->id(), view); | 716 SetView(view->id(), view); |
| 717 } | 717 } |
| 718 | 718 |
| 719 void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host, | 719 void OpaqueBrowserFrameViewLayout::ViewRemoved(views::View* host, |
| 720 views::View* view) { | 720 views::View* view) { |
| 721 SetView(view->id(), nullptr); | 721 SetView(view->id(), nullptr); |
| 722 } | 722 } |
| OLD | NEW |