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

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

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 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
7 #pragma once 7 #pragma once
8 8
9 #include <set>
9 #include <string> 10 #include <string>
10 11
11 #include "base/basictypes.h" 12 #include "base/basictypes.h"
12 #include "content/browser/tab_contents/navigation_entry.h" 13 #include "content/browser/tab_contents/navigation_entry.h"
13 #include "content/common/navigation_types.h" 14 #include "content/common/navigation_types.h"
14 #include "content/common/page_transition_types.h" 15 #include "content/common/page_transition_types.h"
15 #include "ui/gfx/native_widget_types.h" 16 #include "ui/gfx/native_widget_types.h"
16 #include "webkit/glue/window_open_disposition.h" 17 #include "webkit/glue/window_open_disposition.h"
17 18
18 namespace content { 19 namespace content {
(...skipping 24 matching lines...) Expand all
43 public: 44 public:
44 // When a main frame navigation occurs CreateMainFrameCommitDetails() is 45 // When a main frame navigation occurs CreateMainFrameCommitDetails() is
45 // invoked. The |MainFrameCommitDetails| returned from 46 // invoked. The |MainFrameCommitDetails| returned from
46 // CreateMainFrameCommitDetails() are then passed to 47 // CreateMainFrameCommitDetails() are then passed to
47 // DidNavigateMainFramePostCommit. This allows the delegate to save state 48 // DidNavigateMainFramePostCommit. This allows the delegate to save state
48 // before the commit and get that state after the commit. 49 // before the commit and get that state after the commit.
49 struct MainFrameCommitDetails { 50 struct MainFrameCommitDetails {
50 virtual ~MainFrameCommitDetails() {} 51 virtual ~MainFrameCommitDetails() {}
51 }; 52 };
52 53
54 // Called when |this| becomes the TabContentsDelegate for |source|.
sky 2011/06/23 18:51:27 I don't like seeing these in the public section. H
cbentzel 2011/06/23 19:09:57 Done.
55 void Attach(TabContents* source);
56
57 // Called when |this| is no longer the TabContentsDelegate for |source|.
58 void Detach(TabContents* source);
59
53 // Opens a new URL inside the passed in TabContents (if source is 0 open 60 // Opens a new URL inside the passed in TabContents (if source is 0 open
54 // in the current front-most tab), unless |disposition| indicates the url 61 // in the current front-most tab), unless |disposition| indicates the url
55 // should be opened in a new tab or window. 62 // should be opened in a new tab or window.
56 // 63 //
57 // A NULL source indicates the current tab (callers should probably use 64 // A NULL source indicates the current tab (callers should probably use
58 // OpenURL() for these cases which does it for you). 65 // OpenURL() for these cases which does it for you).
59 virtual void OpenURLFromTab(TabContents* source, 66 virtual void OpenURLFromTab(TabContents* source,
60 const GURL& url, const GURL& referrer, 67 const GURL& url, const GURL& referrer,
61 WindowOpenDisposition disposition, 68 WindowOpenDisposition disposition,
62 PageTransition::Type transition) = 0; 69 PageTransition::Type transition) = 0;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 TabContents* tab, 310 TabContents* tab,
304 const MainFrameCommitDetails& details); 311 const MainFrameCommitDetails& details);
305 312
306 // Returns a pointer to a service to create JavaScript dialogs. The default 313 // Returns a pointer to a service to create JavaScript dialogs. The default
307 // pointer returned is to a stub service that marks all dialogs as suppressed 314 // pointer returned is to a stub service that marks all dialogs as suppressed
308 // and displays nothing. 315 // and displays nothing.
309 virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator(); 316 virtual content::JavaScriptDialogCreator* GetJavaScriptDialogCreator();
310 317
311 protected: 318 protected:
312 virtual ~TabContentsDelegate(); 319 virtual ~TabContentsDelegate();
320
321 private:
322 std::set<TabContents*> attached_contents_;
313 }; 323 };
314 324
315 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_ 325 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698