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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 } | 371 } |
372 | 372 |
373 gfx::ImageSkia BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() { | 373 gfx::ImageSkia BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() { |
374 views::WidgetDelegate* delegate = frame()->widget_delegate(); | 374 views::WidgetDelegate* delegate = frame()->widget_delegate(); |
375 if (!delegate) | 375 if (!delegate) |
376 return gfx::ImageSkia(); | 376 return gfx::ImageSkia(); |
377 return delegate->GetWindowIcon(); | 377 return delegate->GetWindowIcon(); |
378 } | 378 } |
379 | 379 |
380 /////////////////////////////////////////////////////////////////////////////// | 380 /////////////////////////////////////////////////////////////////////////////// |
381 // views::View: | |
382 | |
383 void BrowserNonClientFrameViewAsh:: | |
384 ChildPreferredSizeChanged(views::View* child) { | |
385 // FrameCaptionButtonContainerView animates the visibility changes in | |
386 // UpdateSizeButtonVisibility(false). Due to this a new size is not available | |
387 // until the completion of the animation. Layout in response to the preferred | |
388 // size changes. | |
389 if (child != caption_button_container_) | |
390 return; | |
391 frame()->GetRootView()->Layout(); | |
392 } | |
393 | |
394 /////////////////////////////////////////////////////////////////////////////// | |
395 // BrowserNonClientFrameViewAsh, private: | 381 // BrowserNonClientFrameViewAsh, private: |
396 | 382 |
397 int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { | 383 int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { |
398 return avatar_button() ? kAvatarSideSpacing + | 384 return avatar_button() ? kAvatarSideSpacing + |
399 browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing : | 385 browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing : |
400 kTabstripLeftSpacing; | 386 kTabstripLeftSpacing; |
401 } | 387 } |
402 | 388 |
403 int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const { | 389 int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const { |
404 return caption_button_container_->GetPreferredSize().width() + | 390 return caption_button_container_->GetPreferredSize().width() + |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 534 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
549 } | 535 } |
550 | 536 |
551 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { | 537 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { |
552 DCHECK(!UsePackagedAppHeaderStyle()); | 538 DCHECK(!UsePackagedAppHeaderStyle()); |
553 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), | 539 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), |
554 width(), kClientEdgeThickness), | 540 width(), kClientEdgeThickness), |
555 ThemeProperties::GetDefaultColor( | 541 ThemeProperties::GetDefaultColor( |
556 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 542 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
557 } | 543 } |
OLD | NEW |