OLD | NEW |
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/profiles/profile.h" | 5 #include "chrome/browser/profiles/profile.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
12 #include "chrome/browser/first_run/first_run.h" | 12 #include "chrome/browser/first_run/first_run.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "chrome/browser/sync/profile_sync_service.h" | 14 #include "chrome/browser/sync/profile_sync_service.h" |
15 #include "chrome/browser/sync/profile_sync_service_factory.h" | 15 #include "chrome/browser/sync/profile_sync_service_factory.h" |
16 #include "chrome/browser/sync/sync_prefs.h" | 16 #include "chrome/browser/sync/sync_prefs.h" |
17 #include "chrome/common/pref_names.h" | 17 #include "chrome/common/pref_names.h" |
| 18 #include "chrome/common/url_constants.h" |
18 #include "components/user_prefs/pref_registry_syncable.h" | 19 #include "components/user_prefs/pref_registry_syncable.h" |
19 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
20 #include "content/public/browser/notification_source.h" | 21 #include "content/public/browser/notification_source.h" |
21 #include "content/public/browser/web_contents.h" | 22 #include "content/public/browser/web_contents.h" |
22 #include "content/public/browser/web_ui.h" | 23 #include "content/public/browser/web_ui.h" |
23 | 24 |
24 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
25 #include "base/command_line.h" | 26 #include "base/command_line.h" |
26 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
27 #include "chromeos/chromeos_switches.h" | 28 #include "chromeos/chromeos_switches.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 199 |
199 void Profile::MaybeSendDestroyedNotification() { | 200 void Profile::MaybeSendDestroyedNotification() { |
200 if (!sent_destroyed_notification_) { | 201 if (!sent_destroyed_notification_) { |
201 sent_destroyed_notification_ = true; | 202 sent_destroyed_notification_ = true; |
202 content::NotificationService::current()->Notify( | 203 content::NotificationService::current()->Notify( |
203 chrome::NOTIFICATION_PROFILE_DESTROYED, | 204 chrome::NOTIFICATION_PROFILE_DESTROYED, |
204 content::Source<Profile>(this), | 205 content::Source<Profile>(this), |
205 content::NotificationService::NoDetails()); | 206 content::NotificationService::NoDetails()); |
206 } | 207 } |
207 } | 208 } |
| 209 |
| 210 std::string Profile::GetStoragePartitionIdForSite(const GURL& site) { |
| 211 std::string partition_id; |
| 212 |
| 213 // The partition ID for webview guest processes is the string value of its |
| 214 // SiteInstance URL - "chrome-guest://app_id/persist?partition". |
| 215 if (site.SchemeIs(chrome::kGuestScheme)) |
| 216 partition_id = site.spec(); |
| 217 |
| 218 return partition_id; |
| 219 } |
OLD | NEW |