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

Side by Side Diff: components/exo/shell_surface.cc

Issue 2291923002: Check target value
Patch Set: Test Created 4 years, 3 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/rotator/window_rotation.cc ('k') | ui/compositor/layer_animation_element.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/exo/shell_surface.h" 5 #include "components/exo/shell_surface.h"
6 6
7 #include "ash/aura/wm_window_aura.h" 7 #include "ash/aura/wm_window_aura.h"
8 #include "ash/common/shell_window_ids.h" 8 #include "ash/common/shell_window_ids.h"
9 #include "ash/common/wm/window_resizer.h" 9 #include "ash/common/wm/window_resizer.h"
10 #include "ash/common/wm/window_state.h" 10 #include "ash/common/wm/window_state.h"
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1267 origin -= window->bounds().origin().OffsetFromOrigin(); 1267 origin -= window->bounds().origin().OffsetFromOrigin();
1268 shadow_bounds.set_origin(origin); 1268 shadow_bounds.set_origin(origin);
1269 shadow_bounds.set_size(window->parent()->bounds().size()); 1269 shadow_bounds.set_size(window->parent()->bounds().size());
1270 shadow_underlay_opacity = 1.0f; 1270 shadow_underlay_opacity = 1.0f;
1271 } 1271 }
1272 1272
1273 shadow_underlay_->SetBounds(shadow_bounds); 1273 shadow_underlay_->SetBounds(shadow_bounds);
1274 1274
1275 // TODO(oshima): Setting to the same value should be no-op. 1275 // TODO(oshima): Setting to the same value should be no-op.
1276 // crbug.com/642223. 1276 // crbug.com/642223.
1277 if (shadow_underlay_opacity != 1277 //if (shadow_underlay_opacity !=
1278 shadow_underlay_->layer()->GetTargetOpacity()) { 1278 //shadow_underlay_->layer()->GetTargetOpacity()) {
1279 shadow_underlay_->layer()->SetOpacity(shadow_underlay_opacity); 1279 shadow_underlay_->layer()->SetOpacity(shadow_underlay_opacity);
1280 } 1280 //}
1281 1281
1282 shadow_underlay_->Show(); 1282 shadow_underlay_->Show();
1283 1283
1284 wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window); 1284 wm::Shadow* shadow = wm::ShadowController::GetShadowForWindow(window);
1285 // Maximized/Fullscreen window does not create a shadow. 1285 // Maximized/Fullscreen window does not create a shadow.
1286 if (!shadow) 1286 if (!shadow)
1287 return; 1287 return;
1288 1288
1289 if (!shadow_overlay_) { 1289 if (!shadow_overlay_) {
1290 shadow_overlay_ = new aura::Window(nullptr); 1290 shadow_overlay_ = new aura::Window(nullptr);
1291 DCHECK(shadow_overlay_->owned_by_parent()); 1291 DCHECK(shadow_overlay_->owned_by_parent());
1292 shadow_overlay_->set_ignore_events(true); 1292 shadow_overlay_->set_ignore_events(true);
1293 shadow_overlay_->Init(ui::LAYER_NOT_DRAWN); 1293 shadow_overlay_->Init(ui::LAYER_NOT_DRAWN);
1294 shadow_overlay_->layer()->Add(shadow->layer()); 1294 shadow_overlay_->layer()->Add(shadow->layer());
1295 window->AddChild(shadow_overlay_); 1295 window->AddChild(shadow_overlay_);
1296 shadow_overlay_->Show(); 1296 shadow_overlay_->Show();
1297 } 1297 }
1298 shadow_overlay_->SetBounds(shadow_bounds); 1298 shadow_overlay_->SetBounds(shadow_bounds);
1299 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size())); 1299 shadow->SetContentBounds(gfx::Rect(shadow_bounds.size()));
1300 } 1300 }
1301 } 1301 }
1302 1302
1303 } // namespace exo 1303 } // namespace exo
OLDNEW
« no previous file with comments | « ash/rotator/window_rotation.cc ('k') | ui/compositor/layer_animation_element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698