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 /////////////////////////////////////////////////////////////////////////////// |
381 // BrowserNonClientFrameViewAsh, private: | 395 // BrowserNonClientFrameViewAsh, private: |
382 | 396 |
383 int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { | 397 int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { |
384 return avatar_button() ? kAvatarSideSpacing + | 398 return avatar_button() ? kAvatarSideSpacing + |
385 browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing : | 399 browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing : |
386 kTabstripLeftSpacing; | 400 kTabstripLeftSpacing; |
387 } | 401 } |
388 | 402 |
389 int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const { | 403 int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const { |
390 return caption_button_container_->GetPreferredSize().width() + | 404 return caption_button_container_->GetPreferredSize().width() + |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 548 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
535 } | 549 } |
536 | 550 |
537 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { | 551 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { |
538 DCHECK(!UsePackagedAppHeaderStyle()); | 552 DCHECK(!UsePackagedAppHeaderStyle()); |
539 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), | 553 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), |
540 width(), kClientEdgeThickness), | 554 width(), kClientEdgeThickness), |
541 ThemeProperties::GetDefaultColor( | 555 ThemeProperties::GetDefaultColor( |
542 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 556 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
543 } | 557 } |
OLD | NEW |