Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Side by Side Diff: ash/wm/panels/panel_frame_view.cc

Issue 148003003: Use white header for app windows part #2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "ash/wm/panels/panel_frame_view.h" 5 #include "ash/wm/panels/panel_frame_view.h"
6 6
7 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" 7 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h"
8 #include "ash/wm/frame_border_hit_test_controller.h" 8 #include "ash/wm/frame_border_hit_test_controller.h"
9 #include "ash/wm/header_painter.h" 9 #include "ash/wm/header_painter.h"
10 #include "grit/ash_resources.h" 10 #include "grit/ash_resources.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 if (!header_painter_) 108 if (!header_painter_)
109 return HTNOWHERE; 109 return HTNOWHERE;
110 return FrameBorderHitTestController::NonClientHitTest(this, 110 return FrameBorderHitTestController::NonClientHitTest(this,
111 header_painter_.get(), point); 111 header_painter_.get(), point);
112 } 112 }
113 113
114 void PanelFrameView::OnPaint(gfx::Canvas* canvas) { 114 void PanelFrameView::OnPaint(gfx::Canvas* canvas) {
115 if (!header_painter_) 115 if (!header_painter_)
116 return; 116 return;
117 bool paint_as_active = ShouldPaintAsActive(); 117 bool paint_as_active = ShouldPaintAsActive();
118 caption_button_container_->SetPaintAsActive(paint_as_active);
119
118 int theme_frame_id = 0; 120 int theme_frame_id = 0;
119 if (paint_as_active) 121 if (paint_as_active)
120 theme_frame_id = IDR_AURA_BROWSER_WINDOW_HEADER_BASE_RESTORED_ACTIVE; 122 theme_frame_id = IDR_AURA_WINDOW_HEADER_BASE_ACTIVE;
121 else 123 else
122 theme_frame_id = IDR_AURA_BROWSER_WINDOW_HEADER_BASE_RESTORED_INACTIVE; 124 theme_frame_id = IDR_AURA_WINDOW_HEADER_BASE_INACTIVE;
123 125
124 header_painter_->PaintHeader( 126 HeaderPainter::Mode header_mode = paint_as_active ?
125 canvas, 127 HeaderPainter::MODE_ACTIVE : HeaderPainter::MODE_INACTIVE;
126 theme_frame_id, 128 header_painter_->PaintHeader(canvas, header_mode, theme_frame_id, 0);
127 0);
128 header_painter_->PaintTitleBar(canvas, title_font_list_); 129 header_painter_->PaintTitleBar(canvas, title_font_list_);
129 header_painter_->PaintHeaderContentSeparator(canvas); 130 header_painter_->PaintHeaderContentSeparator(canvas, header_mode);
130 } 131 }
131 132
132 gfx::Rect PanelFrameView::GetBoundsForClientView() const { 133 gfx::Rect PanelFrameView::GetBoundsForClientView() const {
133 if (!header_painter_) 134 if (!header_painter_)
134 return bounds(); 135 return bounds();
135 return HeaderPainter::GetBoundsForClientView( 136 return HeaderPainter::GetBoundsForClientView(
136 NonClientTopBorderHeight(), bounds()); 137 NonClientTopBorderHeight(), bounds());
137 } 138 }
138 139
139 gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds( 140 gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds(
140 const gfx::Rect& client_bounds) const { 141 const gfx::Rect& client_bounds) const {
141 if (!header_painter_) 142 if (!header_painter_)
142 return client_bounds; 143 return client_bounds;
143 return HeaderPainter::GetWindowBoundsForClientBounds( 144 return HeaderPainter::GetWindowBoundsForClientBounds(
144 NonClientTopBorderHeight(), client_bounds); 145 NonClientTopBorderHeight(), client_bounds);
145 } 146 }
146 147
147 } // namespace ash 148 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/header_painter.cc ('k') | chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698