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

Side by Side Diff: chrome/browser/extensions/api/web_view/web_view_internal_api.cc

Issue 525793002: Make WebContentsObserver::web_contents() public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 6 years, 3 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
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/web_view/web_view_internal_api.h" 5 #include "chrome/browser/extensions/api/web_view/web_view_internal_api.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h" 8 #include "chrome/browser/extensions/api/browsing_data/browsing_data_api.h"
9 #include "chrome/browser/extensions/api/context_menus/context_menus_api.h" 9 #include "chrome/browser/extensions/api/context_menus/context_menus_api.h"
10 #include "chrome/browser/extensions/api/context_menus/context_menus_api_helpers. h" 10 #include "chrome/browser/extensions/api/context_menus/context_menus_api_helpers. h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 } 347 }
348 348
349 bool WebViewInternalCaptureVisibleRegionFunction::IsScreenshotEnabled() { 349 bool WebViewInternalCaptureVisibleRegionFunction::IsScreenshotEnabled() {
350 return true; 350 return true;
351 } 351 }
352 352
353 WebContents* WebViewInternalCaptureVisibleRegionFunction::GetWebContentsForID( 353 WebContents* WebViewInternalCaptureVisibleRegionFunction::GetWebContentsForID(
354 int instance_id) { 354 int instance_id) {
355 WebViewGuest* guest = WebViewGuest::From( 355 WebViewGuest* guest = WebViewGuest::From(
356 render_view_host()->GetProcess()->GetID(), instance_id); 356 render_view_host()->GetProcess()->GetID(), instance_id);
357 return guest ? guest->guest_web_contents() : NULL; 357 return guest ? guest->web_contents() : NULL;
358 } 358 }
359 359
360 void WebViewInternalCaptureVisibleRegionFunction::OnCaptureFailure( 360 void WebViewInternalCaptureVisibleRegionFunction::OnCaptureFailure(
361 FailureReason reason) { 361 FailureReason reason) {
362 SendResponse(false); 362 SendResponse(false);
363 } 363 }
364 364
365 WebViewInternalSetNameFunction::WebViewInternalSetNameFunction() { 365 WebViewInternalSetNameFunction::WebViewInternalSetNameFunction() {
366 } 366 }
367 367
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 break; 519 break;
520 default: 520 default:
521 NOTREACHED(); 521 NOTREACHED();
522 } 522 }
523 523
524 std::string user_input; 524 std::string user_input;
525 if (params->user_input) 525 if (params->user_input)
526 user_input = *params->user_input; 526 user_input = *params->user_input;
527 527
528 WebViewPermissionHelper* web_view_permission_helper = 528 WebViewPermissionHelper* web_view_permission_helper =
529 WebViewPermissionHelper:: FromWebContents(guest->guest_web_contents()); 529 WebViewPermissionHelper::FromWebContents(guest->web_contents());
530 530
531 WebViewPermissionHelper::SetPermissionResult result = 531 WebViewPermissionHelper::SetPermissionResult result =
532 web_view_permission_helper->SetPermission( 532 web_view_permission_helper->SetPermission(
533 params->request_id, action, user_input); 533 params->request_id, action, user_input);
534 534
535 EXTENSION_FUNCTION_VALIDATE( 535 EXTENSION_FUNCTION_VALIDATE(
536 result != WebViewPermissionHelper::SET_PERMISSION_INVALID); 536 result != WebViewPermissionHelper::SET_PERMISSION_INVALID);
537 537
538 SetResult(new base::FundamentalValue( 538 SetResult(new base::FundamentalValue(
539 result == WebViewPermissionHelper::SET_PERMISSION_ALLOWED)); 539 result == WebViewPermissionHelper::SET_PERMISSION_ALLOWED));
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
596 596
597 WebViewInternalTerminateFunction::~WebViewInternalTerminateFunction() { 597 WebViewInternalTerminateFunction::~WebViewInternalTerminateFunction() {
598 } 598 }
599 599
600 bool WebViewInternalTerminateFunction::RunAsyncSafe(WebViewGuest* guest) { 600 bool WebViewInternalTerminateFunction::RunAsyncSafe(WebViewGuest* guest) {
601 guest->Terminate(); 601 guest->Terminate();
602 return true; 602 return true;
603 } 603 }
604 604
605 } // namespace extensions 605 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tab_capture/tab_capture_registry.cc ('k') | chrome/browser/extensions/tab_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698