| 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" | |
| 9 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 10 #include "content/browser/javascript_dialogs.h" | 9 #include "content/browser/javascript_dialogs.h" |
| 11 #include "content/common/url_constants.h" | 10 #include "content/common/url_constants.h" |
| 12 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
| 13 | 12 |
| 14 TabContentsDelegate::TabContentsDelegate() { | |
| 15 } | |
| 16 | |
| 17 std::string TabContentsDelegate::GetNavigationHeaders(const GURL& url) { | 13 std::string TabContentsDelegate::GetNavigationHeaders(const GURL& url) { |
| 18 return std::string(); | 14 return std::string(); |
| 19 } | 15 } |
| 20 | 16 |
| 21 void TabContentsDelegate::LoadProgressChanged(double progress) { | 17 void TabContentsDelegate::LoadProgressChanged(double progress) { |
| 22 } | 18 } |
| 23 | 19 |
| 24 void TabContentsDelegate::DetachContents(TabContents* source) { | 20 void TabContentsDelegate::DetachContents(TabContents* source) { |
| 25 } | 21 } |
| 26 | 22 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 private: | 227 private: |
| 232 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; | 228 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; |
| 233 }; | 229 }; |
| 234 | 230 |
| 235 content::JavaScriptDialogCreator* | 231 content::JavaScriptDialogCreator* |
| 236 TabContentsDelegate::GetJavaScriptDialogCreator() { | 232 TabContentsDelegate::GetJavaScriptDialogCreator() { |
| 237 return JavaScriptDialogCreatorStub::GetInstance(); | 233 return JavaScriptDialogCreatorStub::GetInstance(); |
| 238 } | 234 } |
| 239 | 235 |
| 240 TabContentsDelegate::~TabContentsDelegate() { | 236 TabContentsDelegate::~TabContentsDelegate() { |
| 241 CHECK(attached_contents_.empty()); | |
| 242 } | 237 } |
| 243 | |
| 244 void TabContentsDelegate::Attach(TabContents* tab_contents) { | |
| 245 CHECK(attached_contents_.find(tab_contents) == attached_contents_.end()); | |
| 246 attached_contents_.insert(tab_contents); | |
| 247 } | |
| 248 | |
| 249 void TabContentsDelegate::Detach(TabContents* tab_contents) { | |
| 250 CHECK(attached_contents_.find(tab_contents) != attached_contents_.end()); | |
| 251 attached_contents_.erase(tab_contents); | |
| 252 } | |
| OLD | NEW |