Chromium Code Reviews| 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/common/ash_layout_constants.h" | 9 #include "ash/common/ash_layout_constants.h" |
| 10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h " | 10 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h " |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 401 chrome::MultiUserWindowManager::ShouldShowAvatar( | 401 chrome::MultiUserWindowManager::ShouldShowAvatar( |
| 402 browser_view()->GetNativeWindow())) { | 402 browser_view()->GetNativeWindow())) { |
| 403 UpdateProfileIndicatorIcon(); | 403 UpdateProfileIndicatorIcon(); |
| 404 } | 404 } |
| 405 } | 405 } |
| 406 | 406 |
| 407 /////////////////////////////////////////////////////////////////////////////// | 407 /////////////////////////////////////////////////////////////////////////////// |
| 408 // BrowserNonClientFrameViewAsh, private: | 408 // BrowserNonClientFrameViewAsh, private: |
| 409 | 409 |
| 410 int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { | 410 int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { |
| 411 const int pad = GetLayoutConstant(AVATAR_ICON_PADDING); | 411 const int pad = kAvatarIconPadding; |
|
Peter Kasting
2016/12/08 20:57:49
Nit: Use directly below? If not, could make const
Evan Stade
2016/12/13 01:31:17
Done.
| |
| 412 const int avatar_right = | 412 const int avatar_right = |
| 413 profile_indicator_icon() ? (pad + GetIncognitoAvatarIcon().width()) : 0; | 413 profile_indicator_icon() ? (pad + GetIncognitoAvatarIcon().width()) : 0; |
| 414 return avatar_right + pad; | 414 return avatar_right + pad; |
| 415 } | 415 } |
| 416 | 416 |
| 417 int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const { | 417 int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const { |
| 418 return kTabstripRightSpacing + | 418 return kTabstripRightSpacing + |
| 419 caption_button_container_->GetPreferredSize().width(); | 419 caption_button_container_->GetPreferredSize().width(); |
| 420 } | 420 } |
| 421 | 421 |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 441 } | 441 } |
| 442 | 442 |
| 443 void BrowserNonClientFrameViewAsh::LayoutProfileIndicatorIcon() { | 443 void BrowserNonClientFrameViewAsh::LayoutProfileIndicatorIcon() { |
| 444 DCHECK(profile_indicator_icon()); | 444 DCHECK(profile_indicator_icon()); |
| 445 #if !defined(OS_CHROMEOS) | 445 #if !defined(OS_CHROMEOS) |
| 446 // ChromeOS shows avatar on V1 app. | 446 // ChromeOS shows avatar on V1 app. |
| 447 DCHECK(browser_view()->IsTabStripVisible()); | 447 DCHECK(browser_view()->IsTabStripVisible()); |
| 448 #endif | 448 #endif |
| 449 | 449 |
| 450 const gfx::ImageSkia incognito_icon = GetIncognitoAvatarIcon(); | 450 const gfx::ImageSkia incognito_icon = GetIncognitoAvatarIcon(); |
| 451 const int pad = GetLayoutConstant(AVATAR_ICON_PADDING); | 451 const int pad = kAvatarIconPadding; |
|
Peter Kasting
2016/12/08 20:57:49
Nit: Use directly below? Or make constexpr
Evan Stade
2016/12/13 01:31:17
Done.
| |
| 452 const int avatar_bottom = | 452 const int avatar_bottom = |
| 453 GetTopInset(false) + browser_view()->GetTabStripHeight() - pad; | 453 GetTopInset(false) + browser_view()->GetTabStripHeight() - pad; |
| 454 int avatar_y = avatar_bottom - incognito_icon.height(); | 454 int avatar_y = avatar_bottom - incognito_icon.height(); |
| 455 | 455 |
| 456 // Hide the incognito icon in immersive fullscreen when the tab light bar is | 456 // Hide the incognito icon in immersive fullscreen when the tab light bar is |
| 457 // visible because the header is too short for the icognito icon to be | 457 // visible because the header is too short for the icognito icon to be |
| 458 // recognizable. | 458 // recognizable. |
| 459 const bool avatar_visible = !UseImmersiveLightbarHeaderStyle(); | 459 const bool avatar_visible = !UseImmersiveLightbarHeaderStyle(); |
| 460 const int avatar_height = avatar_visible ? (avatar_bottom - avatar_y) : 0; | 460 const int avatar_height = avatar_visible ? (avatar_bottom - avatar_y) : 0; |
| 461 profile_indicator_icon()->SetBounds(pad, avatar_y, incognito_icon.width(), | 461 profile_indicator_icon()->SetBounds(pad, avatar_y, incognito_icon.width(), |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 toolbar_bounds.width(), 0); | 508 toolbar_bounds.width(), 0); |
| 509 BrowserView::Paint1pxHorizontalLine(canvas, GetToolbarTopSeparatorColor(), | 509 BrowserView::Paint1pxHorizontalLine(canvas, GetToolbarTopSeparatorColor(), |
| 510 separator_rect, true); | 510 separator_rect, true); |
| 511 | 511 |
| 512 // Toolbar/content separator. | 512 // Toolbar/content separator. |
| 513 toolbar_bounds.Inset(kClientEdgeThickness, 0); | 513 toolbar_bounds.Inset(kClientEdgeThickness, 0); |
| 514 BrowserView::Paint1pxHorizontalLine( | 514 BrowserView::Paint1pxHorizontalLine( |
| 515 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), | 515 canvas, tp->GetColor(ThemeProperties::COLOR_TOOLBAR_BOTTOM_SEPARATOR), |
| 516 toolbar_bounds, true); | 516 toolbar_bounds, true); |
| 517 } | 517 } |
| OLD | NEW |