Chromium Code Reviews| 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/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "content/browser/javascript_dialogs.h" | 9 #include "content/browser/javascript_dialogs.h" |
| 10 #include "content/common/url_constants.h" | 10 #include "content/common/url_constants.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 230 } | 230 } |
| 231 private: | 231 private: |
| 232 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; | 232 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; |
| 233 }; | 233 }; |
| 234 | 234 |
| 235 content::JavaScriptDialogCreator* | 235 content::JavaScriptDialogCreator* |
| 236 TabContentsDelegate::GetJavaScriptDialogCreator() { | 236 TabContentsDelegate::GetJavaScriptDialogCreator() { |
| 237 return JavaScriptDialogCreatorStub::GetInstance(); | 237 return JavaScriptDialogCreatorStub::GetInstance(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void TabContentsDelegate::Attach(TabContents* tab_contents) { | |
|
sky
2011/06/23 18:27:32
Position should match header.
cbentzel
2011/06/23 18:38:13
Done.
| |
| 241 CHECK(attached_contents_.find(tab_contents) == attached_contents_.end()); | |
| 242 attached_contents_.insert(tab_contents); | |
| 243 } | |
| 244 | |
| 245 void TabContentsDelegate::Detach(TabContents* tab_contents) { | |
| 246 CHECK(attached_contents_.find(tab_contents) != attached_contents_.end()); | |
| 247 attached_contents_.erase(tab_contents); | |
| 248 } | |
| 249 | |
| 240 TabContentsDelegate::~TabContentsDelegate() { | 250 TabContentsDelegate::~TabContentsDelegate() { |
| 251 CHECK(attached_contents_.empty()); | |
| 241 } | 252 } |
| OLD | NEW |