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

Side by Side Diff: extensions/browser/process_manager.cc

Issue 890083002: [Extensions] Propagate activeTab hosts to extension background pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « extensions/browser/process_manager.h ('k') | extensions/browser/renderer_startup_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "extensions/browser/process_manager.h" 5 #include "extensions/browser/process_manager.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/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 if (host->extension_id() == extension_id) 371 if (host->extension_id() == extension_id)
372 return host; 372 return host;
373 } 373 }
374 return NULL; 374 return NULL;
375 } 375 }
376 376
377 std::set<RenderViewHost*> ProcessManager::GetRenderViewHostsForExtension( 377 std::set<RenderViewHost*> ProcessManager::GetRenderViewHostsForExtension(
378 const std::string& extension_id) { 378 const std::string& extension_id) {
379 std::set<RenderViewHost*> result; 379 std::set<RenderViewHost*> result;
380 380
381 SiteInstance* site_instance = GetSiteInstanceForURL( 381 scoped_refptr<SiteInstance> site_instance(GetSiteInstanceForURL(
382 Extension::GetBaseURLFromExtensionId(extension_id)); 382 Extension::GetBaseURLFromExtensionId(extension_id)));
383 if (!site_instance) 383 if (!site_instance.get())
384 return result; 384 return result;
385 385
386 // Gather up all the views for that site. 386 // Gather up all the views for that site.
387 for (ExtensionRenderViews::iterator view = all_extension_views_.begin(); 387 for (ExtensionRenderViews::iterator view = all_extension_views_.begin();
388 view != all_extension_views_.end(); ++view) { 388 view != all_extension_views_.end(); ++view) {
389 if (view->first->GetSiteInstance() == site_instance) 389 if (view->first->GetSiteInstance() == site_instance)
390 result.insert(view->first); 390 result.insert(view->first);
391 } 391 }
392 392
393 return result; 393 return result;
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 if (extension && !IncognitoInfo::IsSplitMode(extension)) { 1033 if (extension && !IncognitoInfo::IsSplitMode(extension)) {
1034 BrowserContext* original_context = 1034 BrowserContext* original_context =
1035 ExtensionsBrowserClient::Get()->GetOriginalContext(GetBrowserContext()); 1035 ExtensionsBrowserClient::Get()->GetOriginalContext(GetBrowserContext());
1036 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url); 1036 return ProcessManager::Get(original_context)->GetSiteInstanceForURL(url);
1037 } 1037 }
1038 1038
1039 return ProcessManager::GetSiteInstanceForURL(url); 1039 return ProcessManager::GetSiteInstanceForURL(url);
1040 } 1040 }
1041 1041
1042 } // namespace extensions 1042 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/process_manager.h ('k') | extensions/browser/renderer_startup_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698