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/web_contents/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2478 // This exists for render views that don't have a WebUI, but do have WebUI | 2478 // This exists for render views that don't have a WebUI, but do have WebUI |
2479 // bindings enabled. | 2479 // bindings enabled. |
2480 void WebContentsImpl::OnWebUISend(const GURL& source_url, | 2480 void WebContentsImpl::OnWebUISend(const GURL& source_url, |
2481 const std::string& name, | 2481 const std::string& name, |
2482 const base::ListValue& args) { | 2482 const base::ListValue& args) { |
2483 if (delegate_) | 2483 if (delegate_) |
2484 delegate_->WebUISend(this, source_url, name, args); | 2484 delegate_->WebUISend(this, source_url, name, args); |
2485 } | 2485 } |
2486 | 2486 |
2487 void WebContentsImpl::OnRequestPpapiBrokerPermission( | 2487 void WebContentsImpl::OnRequestPpapiBrokerPermission( |
2488 int request_id, | 2488 int routing_id, |
2489 const GURL& url, | 2489 const GURL& url, |
2490 const base::FilePath& plugin_path) { | 2490 const base::FilePath& plugin_path) { |
2491 if (!delegate_) { | 2491 if (!delegate_) { |
2492 OnPpapiBrokerPermissionResult(request_id, false); | 2492 OnPpapiBrokerPermissionResult(routing_id, false); |
2493 return; | 2493 return; |
2494 } | 2494 } |
2495 | 2495 |
2496 if (!delegate_->RequestPpapiBrokerPermission( | 2496 if (!delegate_->RequestPpapiBrokerPermission( |
2497 this, url, plugin_path, | 2497 this, url, plugin_path, |
2498 base::Bind(&WebContentsImpl::OnPpapiBrokerPermissionResult, | 2498 base::Bind(&WebContentsImpl::OnPpapiBrokerPermissionResult, |
2499 base::Unretained(this), request_id))) { | 2499 base::Unretained(this), routing_id))) { |
2500 NOTIMPLEMENTED(); | 2500 NOTIMPLEMENTED(); |
2501 OnPpapiBrokerPermissionResult(request_id, false); | 2501 OnPpapiBrokerPermissionResult(routing_id, false); |
2502 } | 2502 } |
2503 } | 2503 } |
2504 | 2504 |
2505 void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id, | 2505 void WebContentsImpl::OnPpapiBrokerPermissionResult(int routing_id, |
2506 bool result) { | 2506 bool result) { |
2507 RenderViewHostImpl* rvh = GetRenderViewHostImpl(); | 2507 Send(new ViewMsg_PpapiBrokerPermissionResult(routing_id, result)); |
2508 rvh->Send(new ViewMsg_PpapiBrokerPermissionResult(rvh->GetRoutingID(), | |
2509 request_id, | |
2510 result)); | |
2511 } | 2508 } |
2512 | 2509 |
2513 void WebContentsImpl::OnBrowserPluginMessage(const IPC::Message& message) { | 2510 void WebContentsImpl::OnBrowserPluginMessage(const IPC::Message& message) { |
2514 // This creates a BrowserPluginEmbedder, which handles all the BrowserPlugin | 2511 // This creates a BrowserPluginEmbedder, which handles all the BrowserPlugin |
2515 // specific messages for this WebContents. This means that any message from | 2512 // specific messages for this WebContents. This means that any message from |
2516 // a BrowserPlugin prior to this will be ignored. | 2513 // a BrowserPlugin prior to this will be ignored. |
2517 // For more info, see comment above classes BrowserPluginEmbedder and | 2514 // For more info, see comment above classes BrowserPluginEmbedder and |
2518 // BrowserPluginGuest. | 2515 // BrowserPluginGuest. |
2519 CHECK(!browser_plugin_embedder_.get()); | 2516 CHECK(!browser_plugin_embedder_.get()); |
2520 browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); | 2517 browser_plugin_embedder_.reset(BrowserPluginEmbedder::Create(this)); |
(...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3711 } | 3708 } |
3712 | 3709 |
3713 void WebContentsImpl::ClearAllPowerSaveBlockers() { | 3710 void WebContentsImpl::ClearAllPowerSaveBlockers() { |
3714 for (PowerSaveBlockerMap::iterator i(power_save_blockers_.begin()); | 3711 for (PowerSaveBlockerMap::iterator i(power_save_blockers_.begin()); |
3715 i != power_save_blockers_.end(); ++i) | 3712 i != power_save_blockers_.end(); ++i) |
3716 STLDeleteValues(&power_save_blockers_[i->first]); | 3713 STLDeleteValues(&power_save_blockers_[i->first]); |
3717 power_save_blockers_.clear(); | 3714 power_save_blockers_.clear(); |
3718 } | 3715 } |
3719 | 3716 |
3720 } // namespace content | 3717 } // namespace content |
OLD | NEW |