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

Side by Side Diff: chrome/browser/media_galleries/media_galleries_dialog_controller.cc

Issue 16910002: Destroy StorageMonitorCros before DBusServices (take 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
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 "chrome/browser/media_galleries/media_galleries_dialog_controller.h" 5 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h"
6 6
7 #include "base/i18n/time_formatting.h" 7 #include "base/i18n/time_formatting.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 119
120 preferences_->AddGalleryChangeObserver(this); 120 preferences_->AddGalleryChangeObserver(this);
121 } 121 }
122 122
123 MediaGalleriesDialogController::MediaGalleriesDialogController() 123 MediaGalleriesDialogController::MediaGalleriesDialogController()
124 : web_contents_(NULL), 124 : web_contents_(NULL),
125 extension_(NULL), 125 extension_(NULL),
126 preferences_(NULL) {} 126 preferences_(NULL) {}
127 127
128 MediaGalleriesDialogController::~MediaGalleriesDialogController() { 128 MediaGalleriesDialogController::~MediaGalleriesDialogController() {
129 StorageMonitor::GetInstance()->RemoveObserver(this); 129 if (chrome::StorageMonitor::GetInstance())
130 StorageMonitor::GetInstance()->RemoveObserver(this);
130 131
131 if (select_folder_dialog_.get()) 132 if (select_folder_dialog_.get())
132 select_folder_dialog_->ListenerDestroyed(); 133 select_folder_dialog_->ListenerDestroyed();
133 } 134 }
134 135
135 // static 136 // static
136 string16 MediaGalleriesDialogController::GetGalleryDisplayName( 137 string16 MediaGalleriesDialogController::GetGalleryDisplayName(
137 const MediaGalleryPrefInfo& gallery) { 138 const MediaGalleryPrefInfo& gallery) {
138 string16 name = gallery.display_name; 139 string16 name = gallery.display_name;
139 if (IsAttachedDevice(gallery.device_id)) { 140 if (IsAttachedDevice(gallery.device_id)) {
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 if (iter->pref_info.device_id == device_id) 512 if (iter->pref_info.device_id == device_id)
512 dialog_->UpdateGallery(iter->pref_info, iter->allowed); 513 dialog_->UpdateGallery(iter->pref_info, iter->allowed);
513 } 514 }
514 } 515 }
515 516
516 // MediaGalleries dialog ------------------------------------------------------- 517 // MediaGalleries dialog -------------------------------------------------------
517 518
518 MediaGalleriesDialog::~MediaGalleriesDialog() {} 519 MediaGalleriesDialog::~MediaGalleriesDialog() {}
519 520
520 } // namespace chrome 521 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698