OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/tab_contents/tab_contents_delegate.h" | 5 #include "content/browser/tab_contents/tab_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/browser/javascript_dialogs.h" | 10 #include "content/browser/javascript_dialogs.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 } | 267 } |
268 private: | 268 private: |
269 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; | 269 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; |
270 }; | 270 }; |
271 | 271 |
272 content::JavaScriptDialogCreator* | 272 content::JavaScriptDialogCreator* |
273 TabContentsDelegate::GetJavaScriptDialogCreator() { | 273 TabContentsDelegate::GetJavaScriptDialogCreator() { |
274 return JavaScriptDialogCreatorStub::GetInstance(); | 274 return JavaScriptDialogCreatorStub::GetInstance(); |
275 } | 275 } |
276 | 276 |
| 277 void TabContentsDelegate::UpdatePreferredSize(const gfx::Size& pref_size) { |
| 278 } |
| 279 |
277 TabContentsDelegate::~TabContentsDelegate() { | 280 TabContentsDelegate::~TabContentsDelegate() { |
278 while (!attached_contents_.empty()) { | 281 while (!attached_contents_.empty()) { |
279 TabContents* tab_contents = *attached_contents_.begin(); | 282 TabContents* tab_contents = *attached_contents_.begin(); |
280 tab_contents->set_delegate(NULL); | 283 tab_contents->set_delegate(NULL); |
281 } | 284 } |
282 DCHECK(attached_contents_.empty()); | 285 DCHECK(attached_contents_.empty()); |
283 } | 286 } |
284 | 287 |
285 void TabContentsDelegate::Attach(TabContents* tab_contents) { | 288 void TabContentsDelegate::Attach(TabContents* tab_contents) { |
286 DCHECK(attached_contents_.find(tab_contents) == attached_contents_.end()); | 289 DCHECK(attached_contents_.find(tab_contents) == attached_contents_.end()); |
287 attached_contents_.insert(tab_contents); | 290 attached_contents_.insert(tab_contents); |
288 } | 291 } |
289 | 292 |
290 void TabContentsDelegate::Detach(TabContents* tab_contents) { | 293 void TabContentsDelegate::Detach(TabContents* tab_contents) { |
291 DCHECK(attached_contents_.find(tab_contents) != attached_contents_.end()); | 294 DCHECK(attached_contents_.find(tab_contents) != attached_contents_.end()); |
292 attached_contents_.erase(tab_contents); | 295 attached_contents_.erase(tab_contents); |
293 } | 296 } |
OLD | NEW |