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

Side by Side Diff: chrome/browser/guest_view/web_view/web_view_guest.cc

Issue 273523007: Dispatch geolocation IPCs on the UI thread. Aside from simplifying the code to avoid a lot of threa… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync Created 6 years, 7 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
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/web_view/web_view_guest.h" 5 #include "chrome/browser/guest_view/web_view/web_view_guest.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/extensions/api/web_request/web_request_api.h" 10 #include "chrome/browser/extensions/api/web_request/web_request_api.h"
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 if (!allow || !attached()) { 584 if (!allow || !attached()) {
585 callback.Run(false); 585 callback.Run(false);
586 return; 586 return;
587 } 587 }
588 588
589 content::GeolocationPermissionContext* geolocation_context = 589 content::GeolocationPermissionContext* geolocation_context =
590 browser_context()->GetGeolocationPermissionContext(); 590 browser_context()->GetGeolocationPermissionContext();
591 591
592 DCHECK(geolocation_context); 592 DCHECK(geolocation_context);
593 geolocation_context->RequestGeolocationPermission( 593 geolocation_context->RequestGeolocationPermission(
594 embedder_web_contents()->GetRenderProcessHost()->GetID(), 594 embedder_web_contents(),
595 embedder_web_contents()->GetRoutingID(),
596 // The geolocation permission request here is not initiated 595 // The geolocation permission request here is not initiated
597 // through WebGeolocationPermissionRequest. We are only interested 596 // through WebGeolocationPermissionRequest. We are only interested
598 // in the fact whether the embedder/app has geolocation 597 // in the fact whether the embedder/app has geolocation
599 // permission. Therefore we use an invalid |bridge_id|. 598 // permission. Therefore we use an invalid |bridge_id|.
600 -1 /* bridge_id */, 599 -1 /* bridge_id */,
601 embedder_web_contents()->GetLastCommittedURL(), 600 embedder_web_contents()->GetLastCommittedURL(),
602 user_gesture, 601 user_gesture,
603 callback); 602 callback);
604 } 603 }
605 604
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 if (request_id != pending_context_menu_request_id_) 1073 if (request_id != pending_context_menu_request_id_)
1075 return; 1074 return;
1076 1075
1077 // TODO(lazyboy): Implement. 1076 // TODO(lazyboy): Implement.
1078 DCHECK(!items); 1077 DCHECK(!items);
1079 1078
1080 ContextMenuDelegate* menu_delegate = 1079 ContextMenuDelegate* menu_delegate =
1081 ContextMenuDelegate::FromWebContents(guest_web_contents()); 1080 ContextMenuDelegate::FromWebContents(guest_web_contents());
1082 menu_delegate->ShowMenu(pending_menu_.Pass()); 1081 menu_delegate->ShowMenu(pending_menu_.Pass());
1083 } 1082 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698