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

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

Issue 2215223003: Moves most frame related classes to ash/common/frame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 years, 4 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
« no previous file with comments | « ash/touch/touch_uma.cc ('k') | chrome/browser/ui/views/frame/browser_header_painter_ash.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/common/frame/caption_buttons/frame_caption_button_container_view.h "
8 #include "ash/common/frame/default_header_painter.h"
9 #include "ash/common/frame/frame_border_hit_test.h"
7 #include "ash/common/material_design/material_design_controller.h" 10 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
9 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
10 #include "ash/frame/default_header_painter.h"
11 #include "ash/frame/frame_border_hit_test_controller.h" 12 #include "ash/frame/frame_border_hit_test_controller.h"
12 #include "ui/aura/client/aura_constants.h" 13 #include "ui/aura/client/aura_constants.h"
13 #include "ui/aura/window.h" 14 #include "ui/aura/window.h"
14 #include "ui/base/hit_test.h" 15 #include "ui/base/hit_test.h"
15 #include "ui/gfx/canvas.h" 16 #include "ui/gfx/canvas.h"
16 #include "ui/views/controls/image_view.h" 17 #include "ui/views/controls/image_view.h"
17 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
18 #include "ui/views/widget/widget_delegate.h" 19 #include "ui/views/widget/widget_delegate.h"
19 20
20 namespace ash { 21 namespace ash {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds( 120 gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds(
120 const gfx::Rect& client_bounds) const { 121 const gfx::Rect& client_bounds) const {
121 gfx::Rect window_bounds = client_bounds; 122 gfx::Rect window_bounds = client_bounds;
122 window_bounds.Inset(0, -NonClientTopBorderHeight(), 0, 0); 123 window_bounds.Inset(0, -NonClientTopBorderHeight(), 0, 0);
123 return window_bounds; 124 return window_bounds;
124 } 125 }
125 126
126 int PanelFrameView::NonClientHitTest(const gfx::Point& point) { 127 int PanelFrameView::NonClientHitTest(const gfx::Point& point) {
127 if (!header_painter_) 128 if (!header_painter_)
128 return HTNOWHERE; 129 return HTNOWHERE;
129 return FrameBorderHitTestController::NonClientHitTest( 130 return FrameBorderNonClientHitTest(this, caption_button_container_, point);
130 this, caption_button_container_, point);
131 } 131 }
132 132
133 void PanelFrameView::OnPaint(gfx::Canvas* canvas) { 133 void PanelFrameView::OnPaint(gfx::Canvas* canvas) {
134 if (!header_painter_) 134 if (!header_painter_)
135 return; 135 return;
136 bool paint_as_active = ShouldPaintAsActive(); 136 bool paint_as_active = ShouldPaintAsActive();
137 caption_button_container_->SetPaintAsActive(paint_as_active); 137 caption_button_container_->SetPaintAsActive(paint_as_active);
138 138
139 HeaderPainter::Mode header_mode = paint_as_active 139 HeaderPainter::Mode header_mode = paint_as_active
140 ? HeaderPainter::MODE_ACTIVE 140 ? HeaderPainter::MODE_ACTIVE
141 : HeaderPainter::MODE_INACTIVE; 141 : HeaderPainter::MODE_INACTIVE;
142 header_painter_->PaintHeader(canvas, header_mode); 142 header_painter_->PaintHeader(canvas, header_mode);
143 } 143 }
144 144
145 /////////////////////////////////////////////////////////////////////////////// 145 ///////////////////////////////////////////////////////////////////////////////
146 // PanelFrameView, ShellObserver overrides: 146 // PanelFrameView, ShellObserver overrides:
147 147
148 void PanelFrameView::OnOverviewModeStarting() { 148 void PanelFrameView::OnOverviewModeStarting() {
149 if (ash::MaterialDesignController::IsOverviewMaterial()) 149 if (ash::MaterialDesignController::IsOverviewMaterial())
150 caption_button_container_->SetVisible(false); 150 caption_button_container_->SetVisible(false);
151 } 151 }
152 152
153 void PanelFrameView::OnOverviewModeEnded() { 153 void PanelFrameView::OnOverviewModeEnded() {
154 if (ash::MaterialDesignController::IsOverviewMaterial()) 154 if (ash::MaterialDesignController::IsOverviewMaterial())
155 caption_button_container_->SetVisible(true); 155 caption_button_container_->SetVisible(true);
156 } 156 }
157 157
158 } // namespace ash 158 } // namespace ash
OLDNEW
« no previous file with comments | « ash/touch/touch_uma.cc ('k') | chrome/browser/ui/views/frame/browser_header_painter_ash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698