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