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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 11416013: Move RequestPpapiBrokerPermission from WebContentsObserver to WebContentsDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/public/browser/web_contents_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index c9968d03c841874cda43711e862723e8045235de..73260d3a39bd7262df2f44ca239cc20ca81008a2 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2316,19 +2316,18 @@ void WebContentsImpl::OnRequestPpapiBrokerPermission(
int request_id,
const GURL& url,
const FilePath& plugin_path) {
- base::Callback<void(bool)> callback =
- base::Bind(&WebContentsImpl::OnPpapiBrokerPermissionResult,
- base::Unretained(this), request_id);
- ObserverListBase<WebContentsObserver>::Iterator it(observers_);
- WebContentsObserver* observer;
- while ((observer = it.GetNext()) != NULL) {
- if (observer->RequestPpapiBrokerPermission(this, url, plugin_path,
- callback))
- return;
+ if (!delegate_) {
+ OnPpapiBrokerPermissionResult(request_id, false);
+ return;
}
- // Fall back to allowing the request if no observer handled it.
- OnPpapiBrokerPermissionResult(request_id, true);
+ if (!delegate_->RequestPpapiBrokerPermission(
+ this, url, plugin_path,
+ base::Bind(&WebContentsImpl::OnPpapiBrokerPermissionResult,
+ base::Unretained(this), request_id))) {
+ NOTIMPLEMENTED();
+ OnPpapiBrokerPermissionResult(request_id, false);
+ }
}
void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id,
« no previous file with comments | « chrome/chrome_browser.gypi ('k') | content/public/browser/web_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698