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

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

Issue 1293963002: Fixing the Position of Context Menu for BrowserPlugin (<webview>) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a Build Error in MAC Created 5 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 "extensions/browser/guest_view/web_view/web_view_guest.h" 5 #include "extensions/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 "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "components/browsing_data/storage_partition_http_cache_data_remover.h" 10 #include "components/browsing_data/storage_partition_http_cache_data_remover.h"
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 const std::string& error_type) { 558 const std::string& error_type) {
559 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 559 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
560 args->SetBoolean(guest_view::kIsTopLevel, is_top_level); 560 args->SetBoolean(guest_view::kIsTopLevel, is_top_level);
561 args->SetString(guest_view::kUrl, url.possibly_invalid_spec()); 561 args->SetString(guest_view::kUrl, url.possibly_invalid_spec());
562 args->SetInteger(guest_view::kCode, error_code); 562 args->SetInteger(guest_view::kCode, error_code);
563 args->SetString(guest_view::kReason, error_type); 563 args->SetString(guest_view::kReason, error_type);
564 DispatchEventToView( 564 DispatchEventToView(
565 new GuestViewEvent(webview::kEventLoadAbort, args.Pass())); 565 new GuestViewEvent(webview::kEventLoadAbort, args.Pass()));
566 } 566 }
567 567
568 void WebViewGuest::SetContextMenuPosition(const gfx::Point& position) {
569 if (web_view_guest_delegate_)
570 web_view_guest_delegate_->SetContextMenuPosition(position);
571 }
572
568 void WebViewGuest::CreateNewGuestWebViewWindow( 573 void WebViewGuest::CreateNewGuestWebViewWindow(
569 const content::OpenURLParams& params) { 574 const content::OpenURLParams& params) {
570 GuestViewManager* guest_manager = 575 GuestViewManager* guest_manager =
571 GuestViewManager::FromBrowserContext(browser_context()); 576 GuestViewManager::FromBrowserContext(browser_context());
572 // Set the attach params to use the same partition as the opener. 577 // Set the attach params to use the same partition as the opener.
573 // We pull the partition information from the site's URL, which is of the 578 // We pull the partition information from the site's URL, which is of the
574 // form guest://site/{persist}?{partition_name}. 579 // form guest://site/{persist}?{partition_name}.
575 const GURL& site_url = web_contents()->GetSiteInstance()->GetSiteURL(); 580 const GURL& site_url = web_contents()->GetSiteInstance()->GetSiteURL();
576 const std::string storage_partition_id = 581 const std::string storage_partition_id =
577 GetStoragePartitionIdFromSiteURL(site_url); 582 GetStoragePartitionIdFromSiteURL(site_url);
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
1461 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); 1466 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue());
1462 DispatchEventToView( 1467 DispatchEventToView(
1463 new GuestViewEvent(webview::kEventExitFullscreen, args.Pass())); 1468 new GuestViewEvent(webview::kEventExitFullscreen, args.Pass()));
1464 } 1469 }
1465 // Since we changed fullscreen state, sending a Resize message ensures that 1470 // Since we changed fullscreen state, sending a Resize message ensures that
1466 // renderer/ sees the change. 1471 // renderer/ sees the change.
1467 web_contents()->GetRenderViewHost()->WasResized(); 1472 web_contents()->GetRenderViewHost()->WasResized();
1468 } 1473 }
1469 1474
1470 } // namespace extensions 1475 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698