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/public/browser/web_contents_delegate.h" | 5 #include "content/public/browser/web_contents_delegate.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
10 #include "content/public/browser/render_view_host.h" | 10 #include "content/public/browser/render_view_host.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 } | 136 } |
137 | 137 |
138 void WebContentsDelegate::WebIntentDispatch( | 138 void WebContentsDelegate::WebIntentDispatch( |
139 WebContents* web_contents, | 139 WebContents* web_contents, |
140 WebIntentsDispatcher* intents_dispatcher) { | 140 WebIntentsDispatcher* intents_dispatcher) { |
141 // The caller passes this method ownership of the |intents_dispatcher|, but | 141 // The caller passes this method ownership of the |intents_dispatcher|, but |
142 // this empty implementation will not use it, so we delete it immediately. | 142 // this empty implementation will not use it, so we delete it immediately. |
143 delete intents_dispatcher; | 143 delete intents_dispatcher; |
144 } | 144 } |
145 | 145 |
146 void WebContentsDelegate::RequestPpapiBrokerPermission( | |
147 WebContents* web_contents, | |
148 const GURL& url, | |
149 const FilePath& plugin_path, | |
150 const base::Callback<void(bool)>& callback) { | |
151 callback.Run(false); | |
jam
2012/11/16 17:46:40
nit: don't add this function body, just leave it e
Bernhard Bauer
2012/11/19 08:55:17
Done. I use a return value of false here and true
| |
152 } | |
153 | |
146 WebContentsDelegate::~WebContentsDelegate() { | 154 WebContentsDelegate::~WebContentsDelegate() { |
147 while (!attached_contents_.empty()) { | 155 while (!attached_contents_.empty()) { |
148 WebContents* web_contents = *attached_contents_.begin(); | 156 WebContents* web_contents = *attached_contents_.begin(); |
149 web_contents->SetDelegate(NULL); | 157 web_contents->SetDelegate(NULL); |
150 } | 158 } |
151 DCHECK(attached_contents_.empty()); | 159 DCHECK(attached_contents_.empty()); |
152 } | 160 } |
153 | 161 |
154 void WebContentsDelegate::Attach(WebContents* web_contents) { | 162 void WebContentsDelegate::Attach(WebContents* web_contents) { |
155 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); | 163 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); |
156 attached_contents_.insert(web_contents); | 164 attached_contents_.insert(web_contents); |
157 } | 165 } |
158 | 166 |
159 void WebContentsDelegate::Detach(WebContents* web_contents) { | 167 void WebContentsDelegate::Detach(WebContents* web_contents) { |
160 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); | 168 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); |
161 attached_contents_.erase(web_contents); | 169 attached_contents_.erase(web_contents); |
162 } | 170 } |
163 | 171 |
164 } // namespace content | 172 } // namespace content |
OLD | NEW |