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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 } | 273 } |
274 private: | 274 private: |
275 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; | 275 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; |
276 }; | 276 }; |
277 | 277 |
278 content::JavaScriptDialogCreator* | 278 content::JavaScriptDialogCreator* |
279 TabContentsDelegate::GetJavaScriptDialogCreator() { | 279 TabContentsDelegate::GetJavaScriptDialogCreator() { |
280 return JavaScriptDialogCreatorStub::GetInstance(); | 280 return JavaScriptDialogCreatorStub::GetInstance(); |
281 } | 281 } |
282 | 282 |
| 283 void TabContentsDelegate::UpdatePreferredSize(const gfx::Size& pref_size) { |
| 284 } |
| 285 |
283 TabContentsDelegate::~TabContentsDelegate() { | 286 TabContentsDelegate::~TabContentsDelegate() { |
284 while (!attached_contents_.empty()) { | 287 while (!attached_contents_.empty()) { |
285 TabContents* tab_contents = *attached_contents_.begin(); | 288 TabContents* tab_contents = *attached_contents_.begin(); |
286 tab_contents->set_delegate(NULL); | 289 tab_contents->set_delegate(NULL); |
287 } | 290 } |
288 DCHECK(attached_contents_.empty()); | 291 DCHECK(attached_contents_.empty()); |
289 } | 292 } |
290 | 293 |
291 void TabContentsDelegate::Attach(TabContents* tab_contents) { | 294 void TabContentsDelegate::Attach(TabContents* tab_contents) { |
292 DCHECK(attached_contents_.find(tab_contents) == attached_contents_.end()); | 295 DCHECK(attached_contents_.find(tab_contents) == attached_contents_.end()); |
293 attached_contents_.insert(tab_contents); | 296 attached_contents_.insert(tab_contents); |
294 } | 297 } |
295 | 298 |
296 void TabContentsDelegate::Detach(TabContents* tab_contents) { | 299 void TabContentsDelegate::Detach(TabContents* tab_contents) { |
297 DCHECK(attached_contents_.find(tab_contents) != attached_contents_.end()); | 300 DCHECK(attached_contents_.find(tab_contents) != attached_contents_.end()); |
298 attached_contents_.erase(tab_contents); | 301 attached_contents_.erase(tab_contents); |
299 } | 302 } |
OLD | NEW |