OLD | NEW |
---|---|
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 Loading... | |
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. | |
pkotwicz
2014/03/18 04:41:15
Personally, I would land the changes for hosted ap
oshima
2014/03/18 14:57:03
sure removed from this CL.
| |
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 Loading... | |
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 } |
OLD | NEW |