| OLD | NEW |
| 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 Loading... |
| 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 if (iter->pref_info.device_id == device_id) | 513 if (iter->pref_info.device_id == device_id) |
| 513 dialog_->UpdateGallery(iter->pref_info, iter->allowed); | 514 dialog_->UpdateGallery(iter->pref_info, iter->allowed); |
| 514 } | 515 } |
| 515 } | 516 } |
| 516 | 517 |
| 517 // MediaGalleries dialog ------------------------------------------------------- | 518 // MediaGalleries dialog ------------------------------------------------------- |
| 518 | 519 |
| 519 MediaGalleriesDialog::~MediaGalleriesDialog() {} | 520 MediaGalleriesDialog::~MediaGalleriesDialog() {} |
| 520 | 521 |
| 521 } // namespace chrome | 522 } // namespace chrome |
| OLD | NEW |