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

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

Issue 299753011: Move allocate instance id to chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: HasPermission function moved Created 6 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/api/guest_view/guest_view_internal_api.h"
6
7 #include "chrome/browser/guest_view/guest_view_manager.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/common/extensions/api/guest_view_internal.h"
10 #include "extensions/common/permissions/permissions_data.h"
11
12 namespace extensions {
13
14 GuestViewInternalAllocateInstanceIdFunction::
15 GuestViewInternalAllocateInstanceIdFunction() {
16 }
17
18 bool GuestViewInternalAllocateInstanceIdFunction::RunAsync() {
19 EXTENSION_FUNCTION_VALIDATE(!args_->GetSize());
20
21 // Check if we have "webview" permission.
22 CHECK(GetExtension()->permissions_data()->HasAPIPermission(
23 APIPermission::kWebView));
24
25 int instanceId = GuestViewManager::FromBrowserContext(browser_context())
26 ->GetNextInstanceID();
27 SetResult(base::Value::CreateIntegerValue(instanceId));
28 SendResponse(true);
29 return true;
30 }
31
32 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698