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

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

Issue 8510076: Fix stale compositor references from ui::Layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux_touch build Created 9 years, 1 month 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/gfx/compositor/compositor.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // And let the delegate do any post cleanup. 64 // And let the delegate do any post cleanup.
65 if (delegate_) 65 if (delegate_)
66 delegate_->OnWindowDestroyed(); 66 delegate_->OnWindowDestroyed();
67 if (parent_) 67 if (parent_)
68 parent_->RemoveChild(this); 68 parent_->RemoveChild(this);
69 69
70 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroyed(this)); 70 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowDestroyed(this));
71 } 71 }
72 72
73 void Window::Init(ui::Layer::LayerType layer_type) { 73 void Window::Init(ui::Layer::LayerType layer_type) {
74 layer_.reset(new ui::Layer(Desktop::GetInstance()->compositor(), layer_type)); 74 layer_.reset(new ui::Layer(layer_type));
75 layer_->SetVisible(false); 75 layer_->SetVisible(false);
76 layer_->set_delegate(this); 76 layer_->set_delegate(this);
77 } 77 }
78 78
79 void Window::SetType(WindowType type) { 79 void Window::SetType(WindowType type) {
80 // Cannot change type after the window is initialized. 80 // Cannot change type after the window is initialized.
81 DCHECK(!layer()); 81 DCHECK(!layer());
82 type_ = type; 82 type_ = type;
83 } 83 }
84 84
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 489
490 return delegate_ ? this : NULL; 490 return delegate_ ? this : NULL;
491 } 491 }
492 492
493 void Window::OnPaintLayer(gfx::Canvas* canvas) { 493 void Window::OnPaintLayer(gfx::Canvas* canvas) {
494 if (delegate_) 494 if (delegate_)
495 delegate_->OnPaint(canvas); 495 delegate_->OnPaint(canvas);
496 } 496 }
497 497
498 } // namespace aura 498 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/compositor/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698