Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: content/browser/tab_contents/tab_contents_delegate.cc

Issue 7244009: Helper functions for tracking stale TabContentsDelegate's. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style and destructor Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 void TabContentsDelegate::Attach(TabContents* tab_contents) {
15 CHECK(attached_contents_.find(tab_contents) == attached_contents_.end());
16 attached_contents_.insert(tab_contents);
17 }
18
19 void TabContentsDelegate::Detach(TabContents* tab_contents) {
20 CHECK(attached_contents_.find(tab_contents) != attached_contents_.end());
21 attached_contents_.erase(tab_contents);
22 }
23
13 std::string TabContentsDelegate::GetNavigationHeaders(const GURL& url) { 24 std::string TabContentsDelegate::GetNavigationHeaders(const GURL& url) {
14 return std::string(); 25 return std::string();
15 } 26 }
16 27
17 void TabContentsDelegate::LoadProgressChanged(double progress) { 28 void TabContentsDelegate::LoadProgressChanged(double progress) {
18 } 29 }
19 30
20 void TabContentsDelegate::DetachContents(TabContents* source) { 31 void TabContentsDelegate::DetachContents(TabContents* source) {
21 } 32 }
22 33
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 private: 242 private:
232 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>; 243 friend struct DefaultSingletonTraits<JavaScriptDialogCreatorStub>;
233 }; 244 };
234 245
235 content::JavaScriptDialogCreator* 246 content::JavaScriptDialogCreator*
236 TabContentsDelegate::GetJavaScriptDialogCreator() { 247 TabContentsDelegate::GetJavaScriptDialogCreator() {
237 return JavaScriptDialogCreatorStub::GetInstance(); 248 return JavaScriptDialogCreatorStub::GetInstance();
238 } 249 }
239 250
240 TabContentsDelegate::~TabContentsDelegate() { 251 TabContentsDelegate::~TabContentsDelegate() {
252 CHECK(attached_contents_.empty());
241 } 253 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698