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

Unified Diff: chrome/browser/media_galleries/fileapi/picasa/picasa_finder.cc

Issue 23717027: Media Galleries API Picasa: Move Picasa source files to correct location. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/media_galleries/fileapi/picasa/picasa_finder.cc
diff --git a/chrome/browser/media_galleries/fileapi/picasa/picasa_finder.cc b/chrome/browser/media_galleries/fileapi/picasa/picasa_finder.cc
deleted file mode 100644
index fcec4cc457f9e372e73030f7f66790d9674156f5..0000000000000000000000000000000000000000
--- a/chrome/browser/media_galleries/fileapi/picasa/picasa_finder.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/media_galleries/fileapi/picasa/picasa_finder.h"
-
-#include "base/base_paths.h"
-#include "base/bind.h"
-#include "base/file_util.h"
-#include "base/path_service.h"
-#include "chrome/browser/storage_monitor/storage_info.h"
-#include "chrome/common/media_galleries/picasa_types.h"
-#include "content/public/browser/browser_thread.h"
-
-namespace picasa {
-
-namespace {
-
-// Returns path of Picasa's DB3 database directory. May only be called on
-// threads that allow for disk IO, like the FILE thread or MediaTaskRunner.
-base::FilePath FindPicasaDatabaseOnFileThread() {
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
- base::FilePath path;
-
-#if defined(OS_WIN)
- // TODO(tommycli): Check registry for alternative path.
- if (!PathService::Get(base::DIR_LOCAL_APP_DATA, &path))
- return base::FilePath();
-#elif defined(OS_MACOSX)
- // TODO(tommycli): Check Mac Preferences for alternative path.
- if (!PathService::Get(base::DIR_APP_DATA, &path))
- return base::FilePath();
-#else
- return base::FilePath();
-#endif
-
- path = path.AppendASCII("Google").AppendASCII("Picasa2")
- .AppendASCII(kPicasaDatabaseDirName);
-
- // Verify actual existence
- if (!base::DirectoryExists(path))
- path.clear();
-
- return path;
-}
-
-void FinishOnOriginalThread(const PicasaFinder::DeviceIDCallback& callback,
- const base::FilePath& database_path) {
- if (!database_path.empty())
- callback.Run(chrome::StorageInfo::MakeDeviceId(
- chrome::StorageInfo::PICASA,
- database_path.AsUTF8Unsafe()));
-}
-
-} // namespace
-
-void PicasaFinder::FindPicasaDatabase(
- const PicasaFinder::DeviceIDCallback& callback) {
- content::BrowserThread::PostTaskAndReplyWithResult(
- content::BrowserThread::FILE,
- FROM_HERE,
- base::Bind(&FindPicasaDatabaseOnFileThread),
- base::Bind(&FinishOnOriginalThread, callback));
-}
-
-} // namespace picasa

Powered by Google App Engine
This is Rietveld 408576698