| 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/panels/panel_browser_frame_view.h" | 5 #include "chrome/browser/ui/panels/panel_browser_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 | 430 |
| 431 void PanelBrowserFrameView::UpdateWindowIcon() { | 431 void PanelBrowserFrameView::UpdateWindowIcon() { |
| 432 title_icon_->SchedulePaint(); | 432 title_icon_->SchedulePaint(); |
| 433 } | 433 } |
| 434 | 434 |
| 435 void PanelBrowserFrameView::OnPaint(gfx::Canvas* canvas) { | 435 void PanelBrowserFrameView::OnPaint(gfx::Canvas* canvas) { |
| 436 // The font and color need to be updated depending on the panel's state. | 436 // The font and color need to be updated depending on the panel's state. |
| 437 PaintState paint_state; | 437 PaintState paint_state; |
| 438 if (panel_browser_view_->panel()->IsDrawingAttention()) | 438 if (panel_browser_view_->panel()->IsDrawingAttention()) |
| 439 paint_state = PAINT_FOR_ATTENTION; | 439 paint_state = PAINT_FOR_ATTENTION; |
| 440 else if (panel_browser_view_->focused()) | 440 else if (panel_browser_view_->focused() && |
| 441 !panel_browser_view_->force_to_paint_as_inactive()) |
| 441 paint_state = PAINT_AS_ACTIVE; | 442 paint_state = PAINT_AS_ACTIVE; |
| 442 else | 443 else |
| 443 paint_state = PAINT_AS_INACTIVE; | 444 paint_state = PAINT_AS_INACTIVE; |
| 444 | 445 |
| 445 UpdateControlStyles(paint_state); | 446 UpdateControlStyles(paint_state); |
| 446 PaintFrameBackground(canvas); | 447 PaintFrameBackground(canvas); |
| 447 PaintFrameEdge(canvas); | 448 PaintFrameEdge(canvas); |
| 448 PaintClientEdge(canvas); | 449 PaintClientEdge(canvas); |
| 449 } | 450 } |
| 450 | 451 |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 } | 798 } |
| 798 | 799 |
| 799 bool PanelBrowserFrameView::CanResize() const { | 800 bool PanelBrowserFrameView::CanResize() const { |
| 800 return panel_browser_view_->panel()->CanResizeByMouse() != | 801 return panel_browser_view_->panel()->CanResizeByMouse() != |
| 801 panel::NOT_RESIZABLE; | 802 panel::NOT_RESIZABLE; |
| 802 } | 803 } |
| 803 | 804 |
| 804 bool PanelBrowserFrameView::IsShowingTitlebarOnly() const { | 805 bool PanelBrowserFrameView::IsShowingTitlebarOnly() const { |
| 805 return height() <= kTitlebarHeight; | 806 return height() <= kTitlebarHeight; |
| 806 } | 807 } |
| OLD | NEW |