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/ash_layout_constants.h" | 9 #include "ash/ash_layout_constants.h" |
| 10 #include "ash/common/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 views::WidgetDelegate* delegate = frame()->widget_delegate(); | 390 views::WidgetDelegate* delegate = frame()->widget_delegate(); |
| 391 return delegate ? delegate->GetWindowIcon() : gfx::ImageSkia(); | 391 return delegate ? delegate->GetWindowIcon() : gfx::ImageSkia(); |
| 392 } | 392 } |
| 393 | 393 |
| 394 /////////////////////////////////////////////////////////////////////////////// | 394 /////////////////////////////////////////////////////////////////////////////// |
| 395 // BrowserNonClientFrameViewAsh, protected: | 395 // BrowserNonClientFrameViewAsh, protected: |
| 396 | 396 |
| 397 // BrowserNonClientFrameView: | 397 // BrowserNonClientFrameView: |
| 398 void BrowserNonClientFrameViewAsh::UpdateProfileIcons() { | 398 void BrowserNonClientFrameViewAsh::UpdateProfileIcons() { |
| 399 Browser* browser = browser_view()->browser(); | 399 Browser* browser = browser_view()->browser(); |
| 400 if ((browser->is_type_tabbed() || browser->is_app()) && | 400 const Profile* profile = browser_view()->browser()->profile(); |
|
jdufault
2016/06/10 16:43:23
nit: This can be shortened to browser->profile()
| |
| 401 chrome::MultiUserWindowManager::ShouldShowAvatar( | 401 bool show_avatar = (browser->is_type_tabbed() || browser->is_app()) && |
| 402 browser_view()->GetNativeWindow())) { | 402 chrome::MultiUserWindowManager::ShouldShowAvatar( |
| 403 browser_view()->GetNativeWindow()); | |
| 404 bool is_incognito = profile->GetProfileType() == Profile::INCOGNITO_PROFILE; | |
|
Peter Kasting
2016/06/11 01:54:46
The incognito case can only apply when the (tabbed
| |
| 405 if (show_avatar || is_incognito) { | |
| 403 UpdateProfileIndicatorIcon(); | 406 UpdateProfileIndicatorIcon(); |
| 404 } | 407 } |
| 405 } | 408 } |
| 406 | 409 |
| 407 /////////////////////////////////////////////////////////////////////////////// | 410 /////////////////////////////////////////////////////////////////////////////// |
| 408 // BrowserNonClientFrameViewAsh, private: | 411 // BrowserNonClientFrameViewAsh, private: |
| 409 | 412 |
| 410 // views::NonClientFrameView: | 413 // views::NonClientFrameView: |
| 411 bool BrowserNonClientFrameViewAsh::DoesIntersectRect( | 414 bool BrowserNonClientFrameViewAsh::DoesIntersectRect( |
| 412 const views::View* target, | 415 const views::View* target, |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 583 // TODO(pkasting): The "2 *" part of this makes no sense to me. | 586 // TODO(pkasting): The "2 *" part of this makes no sense to me. |
| 584 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w, | 587 canvas->TileImageInt(*right, 0, 0, w - (2 * kClientEdgeThickness) - img_w, |
| 585 img_y, img_w, img_h); | 588 img_y, img_w, img_h); |
| 586 | 589 |
| 587 // Toolbar/content separator. | 590 // Toolbar/content separator. |
| 588 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, | 591 toolbar_bounds.Inset(kClientEdgeThickness, h - kClientEdgeThickness, |
| 589 kClientEdgeThickness, 0); | 592 kClientEdgeThickness, 0); |
| 590 canvas->FillRect(toolbar_bounds, separator_color); | 593 canvas->FillRect(toolbar_bounds, separator_color); |
| 591 } | 594 } |
| 592 } | 595 } |
| OLD | NEW |