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

Side by Side Diff: chrome/browser/extensions/api/media_galleries_private/media_galleries_private_api.cc

Issue 14556015: [Media Galleries] Lazily initialize the storage monitor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase on prefs Created 7 years, 7 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 "chrome/browser/extensions/api/media_galleries_private/media_galleries_ private_api.h" 5 #include "chrome/browser/extensions/api/media_galleries_private/media_galleries_ private_api.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 376
377 chrome::MediaFileSystemRegistry* registry = 377 chrome::MediaFileSystemRegistry* registry =
378 g_browser_process->media_file_system_registry(); 378 g_browser_process->media_file_system_registry();
379 chrome::MediaGalleriesPreferences* preferences = 379 chrome::MediaGalleriesPreferences* preferences =
380 registry->GetPreferences(profile_); 380 registry->GetPreferences(profile_);
381 base::FilePath file_path(preferences->LookUpGalleryPathForExtension( 381 base::FilePath file_path(preferences->LookUpGalleryPathForExtension(
382 pref_id, GetExtension(), false)); 382 pref_id, GetExtension(), false));
383 383
384 if (file_path.empty) { 384 if (file_path.empty) {
385 error_ = kInvalidGalleryIDError; 385 error_ = kInvalidGalleryIDError;
386 HandleResponse(pref_id, false); 386 return false;
387 return;
388 } 387 }
389 388
390 GalleryWatchStateTracker* state_tracker = 389 GalleryWatchStateTracker* state_tracker =
391 MediaGalleriesPrivateAPI::Get(profile_)->GetGalleryWatchStateTracker(); 390 MediaGalleriesPrivateAPI::Get(profile_)->GetGalleryWatchStateTracker();
392 391
393 content::BrowserThread::PostTask( 392 content::BrowserThread::PostTask(
394 content::BrowserThread::FILE, FROM_HERE, 393 content::BrowserThread::FILE, FROM_HERE,
395 base::Bind(&GalleryWatchManager::RemoveGalleryWatch, 394 base::Bind(&GalleryWatchManager::RemoveGalleryWatch,
396 profile_, 395 profile_,
397 preferences, 396 preferences,
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 } 553 }
555 } 554 }
556 555
557 SetResult(result_list); 556 SetResult(result_list);
558 SendResponse(true); 557 SendResponse(true);
559 558
560 return true; 559 return true;
561 } 560 }
562 561
563 } // namespace extensions 562 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698