Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.cc

Issue 200483004: Show avatar icon on V2 app's frame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" 8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
9 #include "ash/frame/frame_border_hit_test_controller.h" 9 #include "ash/frame/frame_border_hit_test_controller.h"
10 #include "ash/frame/header_painter.h" 10 #include "ash/frame/header_painter.h"
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 // Non streamlined hosted apps do not have a toolbar or tabstrip. Their header 394 // Non streamlined hosted apps do not have a toolbar or tabstrip. Their header
395 // should look the same as the header for packaged apps. Streamlined hosted 395 // should look the same as the header for packaged apps. Streamlined hosted
396 // apps have a toolbar so should use the browser header style. 396 // apps have a toolbar so should use the browser header style.
397 return browser_view()->browser()->is_app() && 397 return browser_view()->browser()->is_app() &&
398 !CommandLine::ForCurrentProcess()->HasSwitch( 398 !CommandLine::ForCurrentProcess()->HasSwitch(
399 switches::kEnableStreamlinedHostedApps); 399 switches::kEnableStreamlinedHostedApps);
400 } 400 }
401 401
402 void BrowserNonClientFrameViewAsh::LayoutAvatar() { 402 void BrowserNonClientFrameViewAsh::LayoutAvatar() {
403 DCHECK(avatar_button()); 403 DCHECK(avatar_button());
404 #if !defined(OS_CHROMEOS)
405 // ChromeOS shows avatar on V1 app.
404 DCHECK(browser_view()->IsTabStripVisible()); 406 DCHECK(browser_view()->IsTabStripVisible());
407 #endif
405 gfx::ImageSkia incognito_icon = browser_view()->GetOTRAvatarIcon(); 408 gfx::ImageSkia incognito_icon = browser_view()->GetOTRAvatarIcon();
406 409
407 int avatar_bottom = GetTopInset() + 410 int avatar_bottom = GetTopInset() +
408 browser_view()->GetTabStripHeight() - kAvatarBottomSpacing; 411 browser_view()->GetTabStripHeight() - kAvatarBottomSpacing;
409 int avatar_restored_y = avatar_bottom - incognito_icon.height(); 412 int avatar_restored_y = avatar_bottom - incognito_icon.height();
410 int avatar_y = (frame()->IsMaximized() || frame()->IsFullscreen()) ? 413 int avatar_y = (frame()->IsMaximized() || frame()->IsFullscreen()) ?
411 GetTopInset() + kContentShadowHeight : avatar_restored_y; 414 GetTopInset() + kContentShadowHeight : avatar_restored_y;
412 415
413 // Hide the incognito icon in immersive fullscreen when the tab light bar is 416 // Hide the incognito icon in immersive fullscreen when the tab light bar is
414 // visible because the header is too short for the icognito icon to be 417 // visible because the header is too short for the icognito icon to be
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 } 582 }
580 583
581 int BrowserNonClientFrameViewAsh::GetFrameImageIdForHostedApp() const { 584 int BrowserNonClientFrameViewAsh::GetFrameImageIdForHostedApp() const {
582 if (UsePackagedAppHeaderStyle()) { 585 if (UsePackagedAppHeaderStyle()) {
583 return ShouldPaintAsActive() ? 586 return ShouldPaintAsActive() ?
584 IDR_AURA_WINDOW_HEADER_BASE_ACTIVE : 587 IDR_AURA_WINDOW_HEADER_BASE_ACTIVE :
585 IDR_AURA_WINDOW_HEADER_BASE_INACTIVE; 588 IDR_AURA_WINDOW_HEADER_BASE_INACTIVE;
586 } 589 }
587 return GetFrameImageIdForBrowserPopup(); 590 return GetFrameImageIdForBrowserPopup();
588 } 591 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698