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

Unified Diff: chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc

Issue 354483004: Implement <appview> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_view_skeleton
Patch Set: Added tests 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc
diff --git a/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc b/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc
index ddf108d5f0ee0b10946361206f0f7054fe079e59..ef09b5baa88ef6e8496aa9f23d70bc1e57dd6b11 100644
--- a/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc
+++ b/chrome/browser/extensions/api/guest_view/guest_view_internal_api.cc
@@ -37,6 +37,7 @@ bool GuestViewInternalCreateGuestFunction::RunAsync() {
LOG(ERROR) << kPermissionRequiredError;
error_ = kPermissionRequiredError;
SendResponse(false);
+ return true;
}
GuestViewManager* guest_view_manager =
@@ -56,10 +57,12 @@ bool GuestViewInternalCreateGuestFunction::RunAsync() {
void GuestViewInternalCreateGuestFunction::CreateGuestCallback(
content::WebContents* guest_web_contents) {
- if (!guest_web_contents)
- return;
- GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents);
- SetResult(base::Value::CreateIntegerValue(guest->GetGuestInstanceID()));
+ int guest_instance_id = 0;
+ if (guest_web_contents) {
+ GuestViewBase* guest = GuestViewBase::FromWebContents(guest_web_contents);
+ guest_instance_id = guest->GetGuestInstanceID();
+ }
+ SetResult(base::Value::CreateIntegerValue(guest_instance_id));
SendResponse(true);
}

Powered by Google App Engine
This is Rietveld 408576698