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/chromeos/login/helper.h" | 5 #include "chrome/browser/chromeos/login/helper.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
11 #include "chrome/browser/chromeos/login/startup_utils.h" | 11 #include "chrome/browser/chromeos/login/startup_utils.h" |
12 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 12 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
13 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 13 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
14 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 14 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
15 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/generated_resources.h" |
16 #include "chromeos/chromeos_switches.h" | 16 #include "chromeos/chromeos_switches.h" |
17 #include "chromeos/network/managed_network_configuration_handler.h" | 17 #include "chromeos/network/managed_network_configuration_handler.h" |
18 #include "chromeos/network/network_handler.h" | 18 #include "chromeos/network/network_handler.h" |
19 #include "chromeos/network/network_state.h" | 19 #include "chromeos/network/network_state.h" |
20 #include "chromeos/network/network_state_handler.h" | 20 #include "chromeos/network/network_state_handler.h" |
| 21 #include "components/guest_view/browser/guest_view_manager.h" |
21 #include "content/public/browser/storage_partition.h" | 22 #include "content/public/browser/storage_partition.h" |
22 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
23 #include "extensions/browser/guest_view/guest_view_manager.h" | |
24 #include "extensions/browser/guest_view/web_view/web_view_guest.h" | 24 #include "extensions/browser/guest_view/web_view/web_view_guest.h" |
25 #include "third_party/cros_system_api/dbus/service_constants.h" | 25 #include "third_party/cros_system_api/dbus/service_constants.h" |
26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
27 #include "ui/gfx/image/image_skia.h" | 27 #include "ui/gfx/image/image_skia.h" |
28 #include "ui/gfx/screen.h" | 28 #include "ui/gfx/screen.h" |
29 | 29 |
30 namespace chromeos { | 30 namespace chromeos { |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
(...skipping 24 matching lines...) Expand all Loading... |
58 *out_guest_contents = guest_contents; | 58 *out_guest_contents = guest_contents; |
59 return true; | 59 return true; |
60 } | 60 } |
61 | 61 |
62 // Gets the storage partition of guest contents of a given embedder. | 62 // Gets the storage partition of guest contents of a given embedder. |
63 // If a name is given, returns the partition associated with the name. | 63 // If a name is given, returns the partition associated with the name. |
64 // Otherwise, returns the default shared in-memory partition. Returns nullptr if | 64 // Otherwise, returns the default shared in-memory partition. Returns nullptr if |
65 // a matching partition could not be found. | 65 // a matching partition could not be found. |
66 content::StoragePartition* GetPartition(content::WebContents* embedder, | 66 content::StoragePartition* GetPartition(content::WebContents* embedder, |
67 const std::string& partition_name) { | 67 const std::string& partition_name) { |
68 extensions::GuestViewManager* manager = | 68 guestview::GuestViewManager* manager = |
69 extensions::GuestViewManager::FromBrowserContext( | 69 guestview::GuestViewManager::FromBrowserContext( |
70 embedder->GetBrowserContext()); | 70 embedder->GetBrowserContext()); |
71 if (!manager) | 71 if (!manager) |
72 return nullptr; | 72 return nullptr; |
73 | 73 |
74 content::WebContents* guest_contents = nullptr; | 74 content::WebContents* guest_contents = nullptr; |
75 manager->ForEachGuest(embedder, base::Bind(&FindGuestByPartitionName, | 75 manager->ForEachGuest(embedder, base::Bind(&FindGuestByPartitionName, |
76 partition_name, &guest_contents)); | 76 partition_name, &guest_contents)); |
77 | 77 |
78 return guest_contents ? content::BrowserContext::GetStoragePartition( | 78 return guest_contents ? content::BrowserContext::GetStoragePartition( |
79 guest_contents->GetBrowserContext(), | 79 guest_contents->GetBrowserContext(), |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 return signin_partition->GetURLRequestContext(); | 205 return signin_partition->GetURLRequestContext(); |
206 } | 206 } |
207 | 207 |
208 return ProfileHelper::GetSigninProfile()->GetRequestContext(); | 208 return ProfileHelper::GetSigninProfile()->GetRequestContext(); |
209 } | 209 } |
210 | 210 |
211 } // namespace login | 211 } // namespace login |
212 | 212 |
213 } // namespace chromeos | 213 } // namespace chromeos |
OLD | NEW |