| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 } | 62 } |
| 63 | 63 |
| 64 bool WebContentsDelegate::TakeFocus(WebContents* source, bool reverse) { | 64 bool WebContentsDelegate::TakeFocus(WebContents* source, bool reverse) { |
| 65 return false; | 65 return false; |
| 66 } | 66 } |
| 67 | 67 |
| 68 int WebContentsDelegate::GetExtraRenderViewHeight() const { | 68 int WebContentsDelegate::GetExtraRenderViewHeight() const { |
| 69 return 0; | 69 return 0; |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool WebContentsDelegate::CanDownload(RenderViewHost* render_view_host, | 72 void WebContentsDelegate::CanDownload( |
| 73 int request_id, | 73 RenderViewHost* render_view_host, |
| 74 const std::string& request_method) { | 74 int request_id, |
| 75 return true; | 75 const std::string& request_method, |
| 76 const base::Callback<void(bool)>& callback) { |
| 77 callback.Run(true); |
| 76 } | 78 } |
| 77 | 79 |
| 78 bool WebContentsDelegate::HandleContextMenu( | 80 bool WebContentsDelegate::HandleContextMenu( |
| 79 const content::ContextMenuParams& params) { | 81 const content::ContextMenuParams& params) { |
| 80 return false; | 82 return false; |
| 81 } | 83 } |
| 82 | 84 |
| 83 void WebContentsDelegate::ViewSourceForTab(WebContents* source, | 85 void WebContentsDelegate::ViewSourceForTab(WebContents* source, |
| 84 const GURL& page_url) { | 86 const GURL& page_url) { |
| 85 // Fall back implementation based entirely on the view-source scheme. | 87 // Fall back implementation based entirely on the view-source scheme. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); | 161 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); |
| 160 attached_contents_.insert(web_contents); | 162 attached_contents_.insert(web_contents); |
| 161 } | 163 } |
| 162 | 164 |
| 163 void WebContentsDelegate::Detach(WebContents* web_contents) { | 165 void WebContentsDelegate::Detach(WebContents* web_contents) { |
| 164 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); | 166 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); |
| 165 attached_contents_.erase(web_contents); | 167 attached_contents_.erase(web_contents); |
| 166 } | 168 } |
| 167 | 169 |
| 168 } // namespace content | 170 } // namespace content |
| OLD | NEW |