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

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 NavigateGuest 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/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"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 extensions::GuestViewManager* manager =
69 extensions::GuestViewManager::FromBrowserContextIfAvailable( 69 extensions::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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698