| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 } | 152 } |
| 153 | 153 |
| 154 void WebContentsDelegate::WebIntentDispatch( | 154 void WebContentsDelegate::WebIntentDispatch( |
| 155 WebContents* web_contents, | 155 WebContents* web_contents, |
| 156 WebIntentsDispatcher* intents_dispatcher) { | 156 WebIntentsDispatcher* intents_dispatcher) { |
| 157 // The caller passes this method ownership of the |intents_dispatcher|, but | 157 // The caller passes this method ownership of the |intents_dispatcher|, but |
| 158 // this empty implementation will not use it, so we delete it immediately. | 158 // this empty implementation will not use it, so we delete it immediately. |
| 159 delete intents_dispatcher; | 159 delete intents_dispatcher; |
| 160 } | 160 } |
| 161 | 161 |
| 162 void WebContentsDelegate::RequestPpapiBrokerPermission( |
| 163 WebContents* web_contents, |
| 164 const GURL& url, |
| 165 const FilePath& plugin_path, |
| 166 const base::Callback<void(bool)>& callback) { |
| 167 callback.Run(false); |
| 168 } |
| 169 |
| 162 WebContentsDelegate::~WebContentsDelegate() { | 170 WebContentsDelegate::~WebContentsDelegate() { |
| 163 while (!attached_contents_.empty()) { | 171 while (!attached_contents_.empty()) { |
| 164 WebContents* web_contents = *attached_contents_.begin(); | 172 WebContents* web_contents = *attached_contents_.begin(); |
| 165 web_contents->SetDelegate(NULL); | 173 web_contents->SetDelegate(NULL); |
| 166 } | 174 } |
| 167 DCHECK(attached_contents_.empty()); | 175 DCHECK(attached_contents_.empty()); |
| 168 } | 176 } |
| 169 | 177 |
| 170 void WebContentsDelegate::Attach(WebContents* web_contents) { | 178 void WebContentsDelegate::Attach(WebContents* web_contents) { |
| 171 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); | 179 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); |
| 172 attached_contents_.insert(web_contents); | 180 attached_contents_.insert(web_contents); |
| 173 } | 181 } |
| 174 | 182 |
| 175 void WebContentsDelegate::Detach(WebContents* web_contents) { | 183 void WebContentsDelegate::Detach(WebContents* web_contents) { |
| 176 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); | 184 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); |
| 177 attached_contents_.erase(web_contents); | 185 attached_contents_.erase(web_contents); |
| 178 } | 186 } |
| 179 | 187 |
| 180 } // namespace content | 188 } // namespace content |
| OLD | NEW |