| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_scan_result_controller.
h" | 5 #include "chrome/browser/media_galleries/media_galleries_scan_result_controller.
h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <list> | 8 #include <list> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 void MediaGalleriesScanResultController::OnPreferenceUpdate( | 322 void MediaGalleriesScanResultController::OnPreferenceUpdate( |
| 323 const std::string& extension_id) { | 323 const std::string& extension_id) { |
| 324 if (extension_id == extension_->id()) { | 324 if (extension_id == extension_->id()) { |
| 325 UpdateScanResultsFromPreferences(preferences_, extension_, | 325 UpdateScanResultsFromPreferences(preferences_, extension_, |
| 326 results_to_remove_, &scan_results_); | 326 results_to_remove_, &scan_results_); |
| 327 dialog_->UpdateGalleries(); | 327 dialog_->UpdateGalleries(); |
| 328 } | 328 } |
| 329 } | 329 } |
| 330 | 330 |
| 331 void MediaGalleriesScanResultController::OnRemovableDeviceUpdate( | 331 void MediaGalleriesScanResultController::OnRemovableDeviceUpdate( |
| 332 const std::string device_id) { | 332 const std::string& device_id) { |
| 333 for (ScanResults::const_iterator it = scan_results_.begin(); | 333 for (ScanResults::const_iterator it = scan_results_.begin(); |
| 334 it != scan_results_.end(); | 334 it != scan_results_.end(); |
| 335 ++it) { | 335 ++it) { |
| 336 if (it->second.pref_info.device_id == device_id) { | 336 if (it->second.pref_info.device_id == device_id) { |
| 337 dialog_->UpdateGalleries(); | 337 dialog_->UpdateGalleries(); |
| 338 return; | 338 return; |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 | 342 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 MediaGalleriesPreferences* /*prefs*/, | 378 MediaGalleriesPreferences* /*prefs*/, |
| 379 MediaGalleryPrefId /*pref_id*/) { | 379 MediaGalleryPrefId /*pref_id*/) { |
| 380 OnPreferenceUpdate(extension_->id()); | 380 OnPreferenceUpdate(extension_->id()); |
| 381 } | 381 } |
| 382 | 382 |
| 383 void MediaGalleriesScanResultController::OnGalleryInfoUpdated( | 383 void MediaGalleriesScanResultController::OnGalleryInfoUpdated( |
| 384 MediaGalleriesPreferences* /*prefs*/, | 384 MediaGalleriesPreferences* /*prefs*/, |
| 385 MediaGalleryPrefId /*pref_id*/) { | 385 MediaGalleryPrefId /*pref_id*/) { |
| 386 OnPreferenceUpdate(extension_->id()); | 386 OnPreferenceUpdate(extension_->id()); |
| 387 } | 387 } |
| OLD | NEW |