| OLD | NEW |
| 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 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 const std::string& error_type) { | 560 const std::string& error_type) { |
| 561 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 561 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 562 args->SetBoolean(guest_view::kIsTopLevel, is_top_level); | 562 args->SetBoolean(guest_view::kIsTopLevel, is_top_level); |
| 563 args->SetString(guest_view::kUrl, url.possibly_invalid_spec()); | 563 args->SetString(guest_view::kUrl, url.possibly_invalid_spec()); |
| 564 args->SetInteger(guest_view::kCode, error_code); | 564 args->SetInteger(guest_view::kCode, error_code); |
| 565 args->SetString(guest_view::kReason, error_type); | 565 args->SetString(guest_view::kReason, error_type); |
| 566 DispatchEventToView( | 566 DispatchEventToView( |
| 567 new GuestViewEvent(webview::kEventLoadAbort, args.Pass())); | 567 new GuestViewEvent(webview::kEventLoadAbort, args.Pass())); |
| 568 } | 568 } |
| 569 | 569 |
| 570 void WebViewGuest::SetContextMenuPosition(const gfx::Point& position) { |
| 571 if (web_view_guest_delegate_) |
| 572 web_view_guest_delegate_->SetContextMenuPosition(position); |
| 573 } |
| 574 |
| 570 void WebViewGuest::CreateNewGuestWebViewWindow( | 575 void WebViewGuest::CreateNewGuestWebViewWindow( |
| 571 const content::OpenURLParams& params) { | 576 const content::OpenURLParams& params) { |
| 572 GuestViewManager* guest_manager = | 577 GuestViewManager* guest_manager = |
| 573 GuestViewManager::FromBrowserContext(browser_context()); | 578 GuestViewManager::FromBrowserContext(browser_context()); |
| 574 // Set the attach params to use the same partition as the opener. | 579 // Set the attach params to use the same partition as the opener. |
| 575 // We pull the partition information from the site's URL, which is of the | 580 // We pull the partition information from the site's URL, which is of the |
| 576 // form guest://site/{persist}?{partition_name}. | 581 // form guest://site/{persist}?{partition_name}. |
| 577 const GURL& site_url = web_contents()->GetSiteInstance()->GetSiteURL(); | 582 const GURL& site_url = web_contents()->GetSiteInstance()->GetSiteURL(); |
| 578 const std::string storage_partition_id = | 583 const std::string storage_partition_id = |
| 579 GetStoragePartitionIdFromSiteURL(site_url); | 584 GetStoragePartitionIdFromSiteURL(site_url); |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1456 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 1461 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 1457 DispatchEventToView( | 1462 DispatchEventToView( |
| 1458 new GuestViewEvent(webview::kEventExitFullscreen, args.Pass())); | 1463 new GuestViewEvent(webview::kEventExitFullscreen, args.Pass())); |
| 1459 } | 1464 } |
| 1460 // Since we changed fullscreen state, sending a Resize message ensures that | 1465 // Since we changed fullscreen state, sending a Resize message ensures that |
| 1461 // renderer/ sees the change. | 1466 // renderer/ sees the change. |
| 1462 web_contents()->GetRenderViewHost()->WasResized(); | 1467 web_contents()->GetRenderViewHost()->WasResized(); |
| 1463 } | 1468 } |
| 1464 | 1469 |
| 1465 } // namespace extensions | 1470 } // namespace extensions |
| OLD | NEW |