diff options
author | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-13 06:58:53 +0000 |
---|---|---|
committer | koz@chromium.org <koz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-13 06:58:53 +0000 |
commit | ac5fd66554e86bcf484b7047aae5e298be5ff0d2 (patch) | |
tree | d2623853846ce660bd2216047e76399cfe1ad53b /chrome/browser/apps/per_app_settings_service.h | |
parent | 5c3f6402c7c928636f62e9861d40ec3da947fc95 (diff) | |
download | chromium_src-ac5fd66554e86bcf484b7047aae5e298be5ff0d2.zip chromium_src-ac5fd66554e86bcf484b7047aae5e298be5ff0d2.tar.gz chromium_src-ac5fd66554e86bcf484b7047aae5e298be5ff0d2.tar.bz2 |
Add PerAppSettingsService and use it to remember what desktop apps should create windows on.
BUG=316062
TBR=ben@chromium.org
Review URL: https://codereview.chromium.org/111553008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244466 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/apps/per_app_settings_service.h')
-rw-r--r-- | chrome/browser/apps/per_app_settings_service.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/chrome/browser/apps/per_app_settings_service.h b/chrome/browser/apps/per_app_settings_service.h new file mode 100644 index 0000000..5832ca3 --- /dev/null +++ b/chrome/browser/apps/per_app_settings_service.h @@ -0,0 +1,36 @@ +// Copyright 2014 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. + +#ifndef CHROME_BROWSER_APPS_PER_APP_SETTINGS_SERVICE_H_ +#define CHROME_BROWSER_APPS_PER_APP_SETTINGS_SERVICE_H_ + +#include <map> +#include <string> + +#include "chrome/browser/ui/host_desktop.h" +#include "components/browser_context_keyed_service/browser_context_keyed_service.h" + +// Stores settings for apps that only persist until the browser context is +// destroyed. +class PerAppSettingsService : public BrowserContextKeyedService { + public: + PerAppSettingsService(); + virtual ~PerAppSettingsService(); + + // Sets/gets the desktop that |app_id| was last launched from. + void SetDesktopLastLaunchedFrom( + const std::string& app_id, chrome::HostDesktopType host); + chrome::HostDesktopType GetDesktopLastLaunchedFrom( + const std::string& app_id) const; + bool HasDesktopLastLaunchedFrom(const std::string& app_id) const; + + private: + typedef std::map<std::string, chrome::HostDesktopType> DesktopMap; + DesktopMap default_desktops_; + + DISALLOW_COPY_AND_ASSIGN(PerAppSettingsService); +}; + +#endif // CHROME_BROWSER_APPS_PER_APP_SETTINGS_SERVICE_H_ + |