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

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: review 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
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 0ef81c6f8e121997fd50d10168b1af10b2f250c9..3c67f27c005191ee5cebfe887ce7c8d3749c888e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2306,19 +2306,15 @@ 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);
+ delegate_->RequestPpapiBrokerPermission(
+ this, url, plugin_path,
+ base::Bind(&WebContentsImpl::OnPpapiBrokerPermissionResult,
+ base::Unretained(this), request_id));
}
void WebContentsImpl::OnPpapiBrokerPermissionResult(int request_id,

Powered by Google App Engine
This is Rietveld 408576698