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

Side by Side Diff: chrome/browser/chromeos/login/helper.cc

Issue 1066563006: GuestView: Move GuestViewManager extension dependencies to ExtensionsGuestViewManagerDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extensions_guest_view_message_filter
Patch Set: Fixed tests Created 5 years, 8 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 unified diff | Download patch
OLDNEW
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/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chromeos/login/startup_utils.h" 10 #include "chrome/browser/chromeos/login/startup_utils.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 return true; 57 return true;
58 } 58 }
59 59
60 // Gets the storage partition of guest contents of a given embedder. 60 // Gets the storage partition of guest contents of a given embedder.
61 // If a name is given, returns the partition associated with the name. 61 // If a name is given, returns the partition associated with the name.
62 // Otherwise, returns the default shared in-memory partition. Returns nullptr if 62 // Otherwise, returns the default shared in-memory partition. Returns nullptr if
63 // a matching partition could not be found. 63 // a matching partition could not be found.
64 content::StoragePartition* GetPartition(content::WebContents* embedder, 64 content::StoragePartition* GetPartition(content::WebContents* embedder,
65 const std::string& partition_name) { 65 const std::string& partition_name) {
66 extensions::GuestViewManager* manager = 66 extensions::GuestViewManager* manager =
67 extensions::GuestViewManager::FromBrowserContextIfAvailable( 67 extensions::GuestViewManager::FromBrowserContext(
68 embedder->GetBrowserContext()); 68 embedder->GetBrowserContext());
69 if (!manager) 69 if (!manager)
70 return nullptr; 70 return nullptr;
71 71
72 content::WebContents* guest_contents = nullptr; 72 content::WebContents* guest_contents = nullptr;
73 manager->ForEachGuest(embedder, base::Bind(&FindGuestByPartitionName, 73 manager->ForEachGuest(embedder, base::Bind(&FindGuestByPartitionName,
74 partition_name, &guest_contents)); 74 partition_name, &guest_contents));
75 75
76 return guest_contents ? content::BrowserContext::GetStoragePartition( 76 return guest_contents ? content::BrowserContext::GetStoragePartition(
77 guest_contents->GetBrowserContext(), 77 guest_contents->GetBrowserContext(),
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 170
171 return signin_partition->GetURLRequestContext(); 171 return signin_partition->GetURLRequestContext();
172 } 172 }
173 173
174 return ProfileHelper::GetSigninProfile()->GetRequestContext(); 174 return ProfileHelper::GetSigninProfile()->GetRequestContext();
175 } 175 }
176 176
177 } // namespace login 177 } // namespace login
178 178
179 } // namespace chromeos 179 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698