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

Side by Side Diff: ash/common/frame/header_view.cc

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: fix comments Created 3 years, 11 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/frame/header_view.h" 5 #include "ash/common/frame/header_view.h"
6 6
7 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h " 7 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h "
8 #include "ash/common/frame/default_header_painter.h" 8 #include "ash/common/frame/default_header_painter.h"
9 #include "ash/common/session/session_state_delegate.h" 9 #include "ash/common/session/session_state_delegate.h"
10 #include "ash/common/wm_lookup.h" 10 #include "ash/common/wm_lookup.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 views::View* HeaderView::avatar_icon() const { 157 views::View* HeaderView::avatar_icon() const {
158 return avatar_icon_; 158 return avatar_icon_;
159 } 159 }
160 160
161 /////////////////////////////////////////////////////////////////////////////// 161 ///////////////////////////////////////////////////////////////////////////////
162 // HeaderView, 162 // HeaderView,
163 // ImmersiveFullscreenControllerDelegate overrides: 163 // ImmersiveFullscreenControllerDelegate overrides:
164 164
165 void HeaderView::OnImmersiveRevealStarted() { 165 void HeaderView::OnImmersiveRevealStarted() {
166 fullscreen_visible_fraction_ = 0; 166 fullscreen_visible_fraction_ = 0;
167 SetPaintToLayer(true); 167 SetPaintToLayer();
168 layer()->SetFillsBoundsOpaquely(false); 168 layer()->SetFillsBoundsOpaquely(false);
169 parent()->Layout(); 169 parent()->Layout();
170 } 170 }
171 171
172 void HeaderView::OnImmersiveRevealEnded() { 172 void HeaderView::OnImmersiveRevealEnded() {
173 fullscreen_visible_fraction_ = 0; 173 fullscreen_visible_fraction_ = 0;
174 SetPaintToLayer(false); 174 DestroyLayer();
175 parent()->Layout(); 175 parent()->Layout();
176 } 176 }
177 177
178 void HeaderView::OnImmersiveFullscreenExited() { 178 void HeaderView::OnImmersiveFullscreenExited() {
179 fullscreen_visible_fraction_ = 0; 179 fullscreen_visible_fraction_ = 0;
180 SetPaintToLayer(false); 180 DestroyLayer();
181 parent()->Layout(); 181 parent()->Layout();
182 } 182 }
183 183
184 void HeaderView::SetVisibleFraction(double visible_fraction) { 184 void HeaderView::SetVisibleFraction(double visible_fraction) {
185 if (fullscreen_visible_fraction_ != visible_fraction) { 185 if (fullscreen_visible_fraction_ != visible_fraction) {
186 fullscreen_visible_fraction_ = visible_fraction; 186 fullscreen_visible_fraction_ = visible_fraction;
187 parent()->Layout(); 187 parent()->Layout();
188 } 188 }
189 } 189 }
190 190
191 std::vector<gfx::Rect> HeaderView::GetVisibleBoundsInScreen() const { 191 std::vector<gfx::Rect> HeaderView::GetVisibleBoundsInScreen() const {
192 // TODO(pkotwicz): Implement views::View::ConvertRectToScreen(). 192 // TODO(pkotwicz): Implement views::View::ConvertRectToScreen().
193 gfx::Rect visible_bounds(GetVisibleBounds()); 193 gfx::Rect visible_bounds(GetVisibleBounds());
194 gfx::Point visible_origin_in_screen(visible_bounds.origin()); 194 gfx::Point visible_origin_in_screen(visible_bounds.origin());
195 views::View::ConvertPointToScreen(this, &visible_origin_in_screen); 195 views::View::ConvertPointToScreen(this, &visible_origin_in_screen);
196 std::vector<gfx::Rect> bounds_in_screen; 196 std::vector<gfx::Rect> bounds_in_screen;
197 bounds_in_screen.push_back( 197 bounds_in_screen.push_back(
198 gfx::Rect(visible_origin_in_screen, visible_bounds.size())); 198 gfx::Rect(visible_origin_in_screen, visible_bounds.size()));
199 return bounds_in_screen; 199 return bounds_in_screen;
200 } 200 }
201 201
202 } // namespace ash 202 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/common/shelf/overflow_bubble_view.cc » ('j') | ui/views/animation/ink_drop_host_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698