summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile_manager.h
diff options
context:
space:
mode:
authorIain Merrick <husky@google.com>2010-10-19 14:37:37 +0100
committerIain Merrick <husky@google.com>2010-10-19 14:37:37 +0100
commit3345a6884c488ff3a535c2c9acdd33d74b37e311 (patch)
tree7784b988ef1698cb6967ea1bdf07616237716c6c /chrome/browser/profile_manager.h
parentefc8475837ec58186051f23bb03542620424f6ce (diff)
downloadexternal_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.zip
external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.gz
external_chromium-3345a6884c488ff3a535c2c9acdd33d74b37e311.tar.bz2
Merge Chromium at 7.0.540.0 : Initial merge by git
Not including third_party/icu as it contains huge data files that break Gerrit, and aren't actually used. Change-Id: I428a386e70f3b58cacd28677b8cfda282e891e15
Diffstat (limited to 'chrome/browser/profile_manager.h')
-rw-r--r--chrome/browser/profile_manager.h54
1 files changed, 3 insertions, 51 deletions
diff --git a/chrome/browser/profile_manager.h b/chrome/browser/profile_manager.h
index 707024b..4d540f1 100644
--- a/chrome/browser/profile_manager.h
+++ b/chrome/browser/profile_manager.h
@@ -6,63 +6,19 @@
#ifndef CHROME_BROWSER_PROFILE_MANAGER_H__
#define CHROME_BROWSER_PROFILE_MANAGER_H__
+#pragma once
-#include <map>
-#include <string>
#include <vector>
#include "app/system_monitor.h"
#include "base/basictypes.h"
-#include "base/file_path.h"
#include "base/message_loop.h"
#include "base/non_thread_safe.h"
-#include "base/values.h"
#include "chrome/browser/profile.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
-// This is a small storage class that simply represents some metadata about
-// profiles that are available in the current user data directory.
-// These are cached in local state so profiles don't need to be scanned
-// for their metadata on every launch.
-class AvailableProfile {
- public:
- AvailableProfile(const std::wstring& name,
- const std::wstring& id,
- const FilePath& directory)
- : name_(name), id_(id), directory_(directory) {}
-
- // Decodes a DictionaryValue into an AvailableProfile
- static AvailableProfile* FromValue(DictionaryValue* value) {
- DCHECK(value);
- std::wstring name, id;
- FilePath::StringType directory;
- value->GetString(L"name", &name);
- value->GetString(L"id", &id);
- value->GetString(L"directory", &directory);
- return new AvailableProfile(name, id, FilePath(directory));
- }
-
- // Encodes this AvailableProfile into a new DictionaryValue
- DictionaryValue* ToValue() {
- DictionaryValue* value = new DictionaryValue;
- value->SetString(L"name", name_);
- value->SetString(L"id", id_);
- value->SetString(L"directory", directory_.value());
- return value;
- }
-
- std::wstring name() const { return name_; }
- std::wstring id() const { return id_; }
- FilePath directory() const { return directory_; }
-
- private:
- std::wstring name_; // User-visible profile name
- std::wstring id_; // Profile identifier
- FilePath directory_; // Subdirectory containing profile (not full path)
-
- DISALLOW_COPY_AND_ASSIGN(AvailableProfile);
-};
+class FilePath;
class ProfileManager : public NonThreadSafe,
public SystemMonitor::PowerObserver,
@@ -111,8 +67,6 @@ class ProfileManager : public NonThreadSafe,
iterator end() { return profiles_.end(); }
const_iterator end() const { return profiles_.end(); }
- typedef std::vector<AvailableProfile*> AvailableProfileVector;
-
// PowerObserver notifications
void OnSuspend();
void OnResume();
@@ -128,7 +82,7 @@ class ProfileManager : public NonThreadSafe,
// user data directory.
static FilePath GetDefaultProfileDir(const FilePath& user_data_dir);
-// Returns the path to the preferences file given the user profile directory.
+ // Returns the path to the preferences file given the user profile directory.
static FilePath GetProfilePrefsPath(const FilePath& profile_dir);
// Tries to determine whether the given path represents a profile
@@ -161,8 +115,6 @@ class ProfileManager : public NonThreadSafe,
// because we expect there to be a small number of profiles active.
ProfileVector profiles_;
- AvailableProfileVector available_profiles_;
-
NotificationRegistrar registrar_;
// Indicates that a user has logged in and that the profile specified