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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 content::ColorChooser* WebContentsDelegate::OpenColorChooser( | 135 content::ColorChooser* WebContentsDelegate::OpenColorChooser( |
136 WebContents* web_contents, | 136 WebContents* web_contents, |
137 int color_chooser_id, | 137 int color_chooser_id, |
138 SkColor color) { | 138 SkColor color) { |
139 return NULL; | 139 return NULL; |
140 } | 140 } |
141 | 141 |
142 bool WebContentsDelegate::RequestPpapiBrokerPermission( | 142 bool WebContentsDelegate::RequestPpapiBrokerPermission( |
143 WebContents* web_contents, | 143 WebContents* web_contents, |
144 const GURL& url, | 144 const GURL& url, |
145 const FilePath& plugin_path, | 145 const base::FilePath& plugin_path, |
146 const base::Callback<void(bool)>& callback) { | 146 const base::Callback<void(bool)>& callback) { |
147 return false; | 147 return false; |
148 } | 148 } |
149 | 149 |
150 WebContentsDelegate::~WebContentsDelegate() { | 150 WebContentsDelegate::~WebContentsDelegate() { |
151 while (!attached_contents_.empty()) { | 151 while (!attached_contents_.empty()) { |
152 WebContents* web_contents = *attached_contents_.begin(); | 152 WebContents* web_contents = *attached_contents_.begin(); |
153 web_contents->SetDelegate(NULL); | 153 web_contents->SetDelegate(NULL); |
154 } | 154 } |
155 DCHECK(attached_contents_.empty()); | 155 DCHECK(attached_contents_.empty()); |
156 } | 156 } |
157 | 157 |
158 void WebContentsDelegate::Attach(WebContents* web_contents) { | 158 void WebContentsDelegate::Attach(WebContents* web_contents) { |
159 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); | 159 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); |
160 attached_contents_.insert(web_contents); | 160 attached_contents_.insert(web_contents); |
161 } | 161 } |
162 | 162 |
163 void WebContentsDelegate::Detach(WebContents* web_contents) { | 163 void WebContentsDelegate::Detach(WebContents* web_contents) { |
164 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); | 164 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); |
165 attached_contents_.erase(web_contents); | 165 attached_contents_.erase(web_contents); |
166 } | 166 } |
167 | 167 |
168 } // namespace content | 168 } // namespace content |
OLD | NEW |