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

Side by Side Diff: ui/aura/window.cc

Issue 139463005: Makes Window::RecreateLayer() reset bounds (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update comment Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/aura/window_unittest.cc » ('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 "ui/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 278
279 Env::GetInstance()->NotifyWindowInitialized(this); 279 Env::GetInstance()->NotifyWindowInitialized(this);
280 } 280 }
281 281
282 ui::Layer* Window::RecreateLayer() { 282 ui::Layer* Window::RecreateLayer() {
283 // Disconnect the old layer, but don't delete it. 283 // Disconnect the old layer, but don't delete it.
284 ui::Layer* old_layer = AcquireLayer(); 284 ui::Layer* old_layer = AcquireLayer();
285 if (!old_layer) 285 if (!old_layer)
286 return NULL; 286 return NULL;
287 287
288 bounds_.SetRect(0, 0, 0, 0);
289
288 old_layer->set_delegate(NULL); 290 old_layer->set_delegate(NULL);
289 291
290 layer_ = new ui::Layer(old_layer->type()); 292 layer_ = new ui::Layer(old_layer->type());
291 layer_owner_.reset(layer_); 293 layer_owner_.reset(layer_);
292 layer_->SetVisible(old_layer->visible()); 294 layer_->SetVisible(old_layer->visible());
293 layer_->set_scale_content(old_layer->scale_content()); 295 layer_->set_scale_content(old_layer->scale_content());
294 layer_->set_delegate(this); 296 layer_->set_delegate(this);
295 layer_->SetMasksToBounds(old_layer->GetMasksToBounds()); 297 layer_->SetMasksToBounds(old_layer->GetMasksToBounds());
296 298
297 if (delegate_) 299 if (delegate_)
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 return window; 1437 return window;
1436 if (offset) 1438 if (offset)
1437 *offset += window->bounds().OffsetFromOrigin(); 1439 *offset += window->bounds().OffsetFromOrigin();
1438 } 1440 }
1439 if (offset) 1441 if (offset)
1440 *offset = gfx::Vector2d(); 1442 *offset = gfx::Vector2d();
1441 return NULL; 1443 return NULL;
1442 } 1444 }
1443 1445
1444 } // namespace aura 1446 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698