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

Side by Side Diff: ash/desktop_background/desktop_background_widget_controller.cc

Issue 10898007: Forget about DesktopBackgroundWidget if it was deleted (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
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/desktop_background/desktop_background_widget_controller.h" 5 #include "ash/desktop_background/desktop_background_widget_controller.h"
6 6
7 #include "ui/aura/root_window.h" 7 #include "ui/aura/root_window.h"
8 #include "ui/views/widget/widget.h" 8 #include "ui/views/widget/widget.h"
9 9
10 DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::DesktopBackgroundWidgetController*); 10 DECLARE_WINDOW_PROPERTY_TYPE(ash::internal::DesktopBackgroundWidgetController*);
(...skipping 11 matching lines...) Expand all
22 } 22 }
23 23
24 DesktopBackgroundWidgetController::DesktopBackgroundWidgetController( 24 DesktopBackgroundWidgetController::DesktopBackgroundWidgetController(
25 ui::Layer* layer) : widget_(NULL) { 25 ui::Layer* layer) : widget_(NULL) {
26 layer_.reset(layer); 26 layer_.reset(layer);
27 } 27 }
28 28
29 DesktopBackgroundWidgetController::~DesktopBackgroundWidgetController() { 29 DesktopBackgroundWidgetController::~DesktopBackgroundWidgetController() {
30 if (widget_) { 30 if (widget_) {
31 widget_->CloseNow(); 31 widget_->CloseNow();
32 widget_ = NULL; 32 widget_ = NULL;
Nikita (slow) 2012/08/28 17:42:38 nit: probably not needed now.
33 } else if (layer_.get()) 33 } else if (layer_.get())
34 layer_.reset(NULL); 34 layer_.reset(NULL);
35 } 35 }
36 36
37 void DesktopBackgroundWidgetController::CleanUpWidget() {
38 widget_ = NULL;
39 }
40
37 void DesktopBackgroundWidgetController::SetBounds(gfx::Rect bounds) { 41 void DesktopBackgroundWidgetController::SetBounds(gfx::Rect bounds) {
38 if (widget_) 42 if (widget_)
39 widget_->SetBounds(bounds); 43 widget_->SetBounds(bounds);
40 else if (layer_.get()) 44 else if (layer_.get())
41 layer_->SetBounds(bounds); 45 layer_->SetBounds(bounds);
42 } 46 }
43 47
44 void DesktopBackgroundWidgetController::Reparent(aura::RootWindow* root_window, 48 void DesktopBackgroundWidgetController::Reparent(aura::RootWindow* root_window,
45 int src_container, 49 int src_container,
46 int dest_container) { 50 int dest_container) {
(...skipping 17 matching lines...) Expand all
64 68
65 DesktopBackgroundWidgetController* ComponentWrapper::GetComponent( 69 DesktopBackgroundWidgetController* ComponentWrapper::GetComponent(
66 bool pass_ownership) { 70 bool pass_ownership) {
67 if (pass_ownership) 71 if (pass_ownership)
68 return component_.release(); 72 return component_.release();
69 return component_.get(); 73 return component_.get();
70 } 74 }
71 75
72 } // namespace internal 76 } // namespace internal
73 } // namespace ash 77 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698