| 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 "content/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 // focus. | 499 // focus. |
| 500 *renderer_prefs = *embedder_web_contents_->GetMutableRendererPrefs(); | 500 *renderer_prefs = *embedder_web_contents_->GetMutableRendererPrefs(); |
| 501 | 501 |
| 502 // We would like the guest to report changes to frame names so that we can | 502 // We would like the guest to report changes to frame names so that we can |
| 503 // update the BrowserPlugin's corresponding 'name' attribute. | 503 // update the BrowserPlugin's corresponding 'name' attribute. |
| 504 // TODO(fsamuel): Remove this once http://crbug.com/169110 is addressed. | 504 // TODO(fsamuel): Remove this once http://crbug.com/169110 is addressed. |
| 505 renderer_prefs->report_frame_name_changes = true; | 505 renderer_prefs->report_frame_name_changes = true; |
| 506 // Navigation is disabled in Chrome Apps. We want to make sure guest-initiated | 506 // Navigation is disabled in Chrome Apps. We want to make sure guest-initiated |
| 507 // navigations still continue to function inside the app. | 507 // navigations still continue to function inside the app. |
| 508 renderer_prefs->browser_handles_all_top_level_requests = false; | 508 renderer_prefs->browser_handles_all_top_level_requests = false; |
| 509 // Disable "client blocked" error page for browser plugin. |
| 510 renderer_prefs->disable_client_blocked_error_page = true; |
| 509 | 511 |
| 510 // Listen to embedder visibility changes so that the guest is in a 'shown' | 512 // Listen to embedder visibility changes so that the guest is in a 'shown' |
| 511 // state if both the embedder is visible and the BrowserPlugin is marked as | 513 // state if both the embedder is visible and the BrowserPlugin is marked as |
| 512 // visible. | 514 // visible. |
| 513 notification_registrar_.Add( | 515 notification_registrar_.Add( |
| 514 this, NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED, | 516 this, NOTIFICATION_WEB_CONTENTS_VISIBILITY_CHANGED, |
| 515 Source<WebContents>(embedder_web_contents_)); | 517 Source<WebContents>(embedder_web_contents_)); |
| 516 | 518 |
| 517 embedder_rvh_observer_.reset(new EmbedderRenderViewHostObserver(this)); | 519 embedder_rvh_observer_.reset(new EmbedderRenderViewHostObserver(this)); |
| 518 | 520 |
| (...skipping 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 request_info.Set(browser_plugin::kRequestMethod, | 1682 request_info.Set(browser_plugin::kRequestMethod, |
| 1681 base::Value::CreateStringValue(request_method)); | 1683 base::Value::CreateStringValue(request_method)); |
| 1682 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); | 1684 request_info.Set(browser_plugin::kURL, base::Value::CreateStringValue(url)); |
| 1683 | 1685 |
| 1684 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, | 1686 RequestPermission(BROWSER_PLUGIN_PERMISSION_TYPE_DOWNLOAD, |
| 1685 new DownloadRequest(callback), | 1687 new DownloadRequest(callback), |
| 1686 request_info); | 1688 request_info); |
| 1687 } | 1689 } |
| 1688 | 1690 |
| 1689 } // namespace content | 1691 } // namespace content |
| OLD | NEW |