| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 scoped_ptr<base::DictionaryValue> extra_params) { | 835 scoped_ptr<base::DictionaryValue> extra_params) { |
| 836 if (opener_web_contents) { | 836 if (opener_web_contents) { |
| 837 GuestView* guest = GuestView::FromWebContents(opener_web_contents); | 837 GuestView* guest = GuestView::FromWebContents(opener_web_contents); |
| 838 if (!guest) { | 838 if (!guest) { |
| 839 NOTREACHED(); | 839 NOTREACHED(); |
| 840 return; | 840 return; |
| 841 } | 841 } |
| 842 | 842 |
| 843 // Create a new GuestView of the same type as the opener. | 843 // Create a new GuestView of the same type as the opener. |
| 844 *guest_delegate = | 844 *guest_delegate = |
| 845 GuestView::Create(guest_web_contents, guest->GetViewType()); | 845 GuestView::Create(guest_web_contents, |
| 846 guest->extension_id(), |
| 847 guest->GetViewType()); |
| 846 return; | 848 return; |
| 847 } | 849 } |
| 848 | 850 |
| 849 if (!extra_params) { | 851 if (!extra_params) { |
| 850 NOTREACHED(); | 852 NOTREACHED(); |
| 851 return; | 853 return; |
| 852 } | 854 } |
| 853 std::string api_type; | 855 std::string api_type; |
| 854 extra_params->GetString(guestview::kParameterApi, &api_type); | 856 extra_params->GetString(guestview::kParameterApi, &api_type); |
| 855 | 857 |
| 858 if (api_type.empty()) |
| 859 return; |
| 860 |
| 856 *guest_delegate = | 861 *guest_delegate = |
| 857 GuestView::Create(guest_web_contents, | 862 GuestView::Create(guest_web_contents, |
| 863 std::string() /* extension_id */, |
| 858 GuestView::GetViewTypeFromString(api_type)); | 864 GuestView::GetViewTypeFromString(api_type)); |
| 859 } | 865 } |
| 860 | 866 |
| 861 void ChromeContentBrowserClient::GuestWebContentsAttached( | 867 void ChromeContentBrowserClient::GuestWebContentsAttached( |
| 862 WebContents* guest_web_contents, | 868 WebContents* guest_web_contents, |
| 863 WebContents* embedder_web_contents, | 869 WebContents* embedder_web_contents, |
| 864 const GURL& embedder_frame_url, | 870 const GURL& embedder_frame_url, |
| 865 const base::DictionaryValue& extra_params) { | 871 const base::DictionaryValue& extra_params) { |
| 866 Profile* profile = Profile::FromBrowserContext( | 872 Profile* profile = Profile::FromBrowserContext( |
| 867 embedder_web_contents->GetBrowserContext()); | 873 embedder_web_contents->GetBrowserContext()); |
| (...skipping 1770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2638 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, | 2644 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, |
| 2639 allowed_file_handle_origins_) || | 2645 allowed_file_handle_origins_) || |
| 2640 IsHostAllowedByCommandLine(url, extension_set, | 2646 IsHostAllowedByCommandLine(url, extension_set, |
| 2641 switches::kAllowNaClFileHandleAPI); | 2647 switches::kAllowNaClFileHandleAPI); |
| 2642 #else | 2648 #else |
| 2643 return false; | 2649 return false; |
| 2644 #endif | 2650 #endif |
| 2645 } | 2651 } |
| 2646 | 2652 |
| 2647 } // namespace chrome | 2653 } // namespace chrome |
| OLD | NEW |