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> | |
flackr
2014/05/08 19:02:21
not used?
jonross
2014/05/08 21:15:40
Cpplint, used outside my changed.
| |
8 | |
7 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
8 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 10 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
9 #include "ash/frame/default_header_painter.h" | 11 #include "ash/frame/default_header_painter.h" |
10 #include "ash/frame/frame_border_hit_test_controller.h" | 12 #include "ash/frame/frame_border_hit_test_controller.h" |
11 #include "ash/frame/header_painter_util.h" | 13 #include "ash/frame/header_painter_util.h" |
12 #include "ash/shell.h" | 14 #include "ash/shell.h" |
13 #include "base/command_line.h" | 15 #include "base/command_line.h" |
14 #include "chrome/browser/themes/theme_properties.h" | 16 #include "chrome/browser/themes/theme_properties.h" |
15 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/views/frame/browser_frame.h" | 18 #include "chrome/browser/ui/views/frame/browser_frame.h" |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 } | 372 } |
371 | 373 |
372 gfx::ImageSkia BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() { | 374 gfx::ImageSkia BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() { |
373 views::WidgetDelegate* delegate = frame()->widget_delegate(); | 375 views::WidgetDelegate* delegate = frame()->widget_delegate(); |
374 if (!delegate) | 376 if (!delegate) |
375 return gfx::ImageSkia(); | 377 return gfx::ImageSkia(); |
376 return delegate->GetWindowIcon(); | 378 return delegate->GetWindowIcon(); |
377 } | 379 } |
378 | 380 |
379 /////////////////////////////////////////////////////////////////////////////// | 381 /////////////////////////////////////////////////////////////////////////////// |
382 // views::View: | |
383 | |
384 void | |
385 BrowserNonClientFrameViewAsh::ChildPreferredSizeChanged(views::View* child) { | |
386 if (child != caption_button_container_) | |
flackr
2014/05/08 19:02:21
Also comment why.
| |
387 return; | |
388 InvalidateLayout(); | |
389 frame()->client_view()->InvalidateLayout(); | |
390 frame()->GetRootView()->Layout(); | |
flackr
2014/05/08 19:02:21
I'm not quite sure what invalidating the layouts a
jonross
2014/05/08 21:15:40
That was recommended when I implemented the Maximi
| |
391 } | |
392 | |
393 /////////////////////////////////////////////////////////////////////////////// | |
380 // BrowserNonClientFrameViewAsh, private: | 394 // BrowserNonClientFrameViewAsh, private: |
381 | 395 |
382 int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { | 396 int BrowserNonClientFrameViewAsh::GetTabStripLeftInset() const { |
383 return avatar_button() ? kAvatarSideSpacing + | 397 return avatar_button() ? kAvatarSideSpacing + |
384 browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing : | 398 browser_view()->GetOTRAvatarIcon().width() + kAvatarSideSpacing : |
385 kTabstripLeftSpacing; | 399 kTabstripLeftSpacing; |
386 } | 400 } |
387 | 401 |
388 int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const { | 402 int BrowserNonClientFrameViewAsh::GetTabStripRightInset() const { |
389 return caption_button_container_->GetPreferredSize().width() + | 403 return caption_button_container_->GetPreferredSize().width() + |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
533 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 547 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
534 } | 548 } |
535 | 549 |
536 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { | 550 void BrowserNonClientFrameViewAsh::PaintContentEdge(gfx::Canvas* canvas) { |
537 DCHECK(!UsePackagedAppHeaderStyle()); | 551 DCHECK(!UsePackagedAppHeaderStyle()); |
538 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), | 552 canvas->FillRect(gfx::Rect(0, caption_button_container_->bounds().bottom(), |
539 width(), kClientEdgeThickness), | 553 width(), kClientEdgeThickness), |
540 ThemeProperties::GetDefaultColor( | 554 ThemeProperties::GetDefaultColor( |
541 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); | 555 ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
542 } | 556 } |
OLD | NEW |