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

Side by Side Diff: chrome/browser/guest_view/guest_view_manager.cc

Issue 409133002: GuestView: Lazy registration and once for all profiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 | « chrome/browser/guest_view/guest_view_base.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/guest_view/guest_view_manager.h" 5 #include "chrome/browser/guest_view/guest_view_manager.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/guest_view/guest_view_base.h" 9 #include "chrome/browser/guest_view/guest_view_base.h"
10 #include "chrome/browser/guest_view/guest_view_constants.h" 10 #include "chrome/browser/guest_view/guest_view_constants.h"
(...skipping 12 matching lines...) Expand all
23 23
24 using content::BrowserContext; 24 using content::BrowserContext;
25 using content::SiteInstance; 25 using content::SiteInstance;
26 using content::WebContents; 26 using content::WebContents;
27 27
28 // static 28 // static
29 GuestViewManagerFactory* GuestViewManager::factory_ = NULL; 29 GuestViewManagerFactory* GuestViewManager::factory_ = NULL;
30 30
31 GuestViewManager::GuestViewManager(content::BrowserContext* context) 31 GuestViewManager::GuestViewManager(content::BrowserContext* context)
32 : current_instance_id_(0), last_instance_id_removed_(0), context_(context) { 32 : current_instance_id_(0), last_instance_id_removed_(0), context_(context) {
33 GuestViewBase::RegisterGuestViewTypes();
34 } 33 }
35 34
36 GuestViewManager::~GuestViewManager() {} 35 GuestViewManager::~GuestViewManager() {}
37 36
38 // static. 37 // static.
39 GuestViewManager* GuestViewManager::FromBrowserContext( 38 GuestViewManager* GuestViewManager::FromBrowserContext(
40 BrowserContext* context) { 39 BrowserContext* context) {
41 GuestViewManager* guest_manager = 40 GuestViewManager* guest_manager =
42 static_cast<GuestViewManager*>(context->GetUserData( 41 static_cast<GuestViewManager*>(context->GetUserData(
43 guestview::kGuestViewManagerKeyName)); 42 guestview::kGuestViewManagerKeyName));
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 guest_web_contents_by_instance_id_.find(guest_instance_id); 235 guest_web_contents_by_instance_id_.find(guest_instance_id);
237 if (it == guest_web_contents_by_instance_id_.end()) 236 if (it == guest_web_contents_by_instance_id_.end())
238 return true; 237 return true;
239 238
240 GuestViewBase* guest_view = GuestViewBase::FromWebContents(it->second); 239 GuestViewBase* guest_view = GuestViewBase::FromWebContents(it->second);
241 if (!guest_view) 240 if (!guest_view)
242 return false; 241 return false;
243 242
244 return embedder_render_process_id == guest_view->embedder_render_process_id(); 243 return embedder_render_process_id == guest_view->embedder_render_process_id();
245 } 244 }
OLDNEW
« no previous file with comments | « chrome/browser/guest_view/guest_view_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698