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

Side by Side Diff: chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc

Issue 426593007: Refactor guest view availability to be API not permission based. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MostLikelyContextType Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/guest_view/app_view/app_view_constants.h » ('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 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/extensions/api/guest_view/guest_view_internal_api.h" 5 #include "chrome/browser/extensions/api/guest_view/guest_view_internal_api.h"
6 6
7 #include "chrome/browser/guest_view/guest_view_base.h" 7 #include "chrome/browser/guest_view/guest_view_base.h"
8 #include "chrome/browser/guest_view/guest_view_manager.h" 8 #include "chrome/browser/guest_view/guest_view_manager.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/common/extensions/api/guest_view_internal.h" 10 #include "chrome/common/extensions/api/guest_view_internal.h"
(...skipping 17 matching lines...) Expand all
28 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &create_params)); 28 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(1, &create_params));
29 29
30 GuestViewManager* guest_view_manager = 30 GuestViewManager* guest_view_manager =
31 GuestViewManager::FromBrowserContext(browser_context()); 31 GuestViewManager::FromBrowserContext(browser_context());
32 32
33 GuestViewManager::WebContentsCreatedCallback callback = 33 GuestViewManager::WebContentsCreatedCallback callback =
34 base::Bind(&GuestViewInternalCreateGuestFunction::CreateGuestCallback, 34 base::Bind(&GuestViewInternalCreateGuestFunction::CreateGuestCallback,
35 this); 35 this);
36 guest_view_manager->CreateGuest(view_type, 36 guest_view_manager->CreateGuest(view_type,
37 extension_id(), 37 extension_id(),
38 render_view_host()->GetProcess()->GetID(), 38 GetAssociatedWebContents(),
39 *create_params, 39 *create_params,
40 callback); 40 callback);
41 41
42 return true; 42 return true;
43 } 43 }
44 44
45 void GuestViewInternalCreateGuestFunction::CreateGuestCallback( 45 void GuestViewInternalCreateGuestFunction::CreateGuestCallback(
46 content::WebContents* guest_web_contents) { 46 content::WebContents* guest_web_contents) {
47 int guest_instance_id = 0; 47 int guest_instance_id = 0;
48 if (guest_web_contents) { 48 if (guest_web_contents) {
(...skipping 23 matching lines...) Expand all
72 guest->SetAutoSize(params->params.enable_auto_size, 72 guest->SetAutoSize(params->params.enable_auto_size,
73 gfx::Size(params->params.min.width, 73 gfx::Size(params->params.min.width,
74 params->params.min.height), 74 params->params.min.height),
75 gfx::Size(params->params.max.width, 75 gfx::Size(params->params.max.width,
76 params->params.max.height)); 76 params->params.max.height));
77 SendResponse(true); 77 SendResponse(true);
78 return true; 78 return true;
79 } 79 }
80 80
81 } // namespace extensions 81 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/guest_view/app_view/app_view_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698