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_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 9 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
10 #include "ash/frame/default_header_painter.h" | 10 #include "ash/frame/default_header_painter.h" |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 gfx::Rect avatar_bounds(kAvatarSideSpacing, | 568 gfx::Rect avatar_bounds(kAvatarSideSpacing, |
569 avatar_y, | 569 avatar_y, |
570 incognito_icon.width(), | 570 incognito_icon.width(), |
571 avatar_height); | 571 avatar_height); |
572 avatar_button()->SetBoundsRect(avatar_bounds); | 572 avatar_button()->SetBoundsRect(avatar_bounds); |
573 avatar_button()->SetVisible(avatar_visible); | 573 avatar_button()->SetVisible(avatar_visible); |
574 } | 574 } |
575 | 575 |
576 #if defined(FRAME_AVATAR_BUTTON) | 576 #if defined(FRAME_AVATAR_BUTTON) |
577 void BrowserNonClientFrameViewAsh::LayoutNewStyleAvatar() { | 577 void BrowserNonClientFrameViewAsh::LayoutNewStyleAvatar() { |
578 DCHECK(switches::IsNewAvatarMenu()); | 578 DCHECK(new_avatar_button()); |
579 | 579 |
580 gfx::Size button_size = new_avatar_button()->GetPreferredSize(); | 580 gfx::Size button_size = new_avatar_button()->GetPreferredSize(); |
581 int button_x = width() - | 581 int button_x = width() - |
582 caption_button_container_->GetPreferredSize().width() - | 582 caption_button_container_->GetPreferredSize().width() - |
583 kNewAvatarButtonOffset - button_size.width(); | 583 kNewAvatarButtonOffset - button_size.width(); |
584 | 584 |
585 new_avatar_button()->SetBounds( | 585 new_avatar_button()->SetBounds( |
586 button_x, | 586 button_x, |
587 0, | 587 0, |
588 button_size.width(), | 588 button_size.width(), |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 } | 710 } |
711 } | 711 } |
712 | 712 |
713 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { | 713 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { |
714 DCHECK(!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle()); | 714 DCHECK(!UsePackagedAppHeaderStyle() && !UseWebAppHeaderStyle()); |
715 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), | 715 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), |
716 width(), kClientEdgeThickness), | 716 width(), kClientEdgeThickness), |
717 ThemeProperties::GetDefaultColor( | 717 ThemeProperties::GetDefaultColor( |
718 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 718 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
719 } | 719 } |
OLD | NEW |