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

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

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: browser_context Created 9 years, 5 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_H_ 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 6 #define CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/gtest_prod_util.h" 14 #include "base/gtest_prod_util.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "base/observer_list.h" 16 #include "base/observer_list.h"
17 #include "base/string16.h" 17 #include "base/string16.h"
18 #include "chrome/browser/profiles/profile.h"
18 #include "content/browser/download/save_package.h" 19 #include "content/browser/download/save_package.h"
19 #include "content/browser/javascript_dialogs.h" 20 #include "content/browser/javascript_dialogs.h"
20 #include "content/browser/renderer_host/render_view_host_delegate.h" 21 #include "content/browser/renderer_host/render_view_host_delegate.h"
21 #include "content/browser/tab_contents/constrained_window.h" 22 #include "content/browser/tab_contents/constrained_window.h"
22 #include "content/browser/tab_contents/navigation_controller.h" 23 #include "content/browser/tab_contents/navigation_controller.h"
23 #include "content/browser/tab_contents/navigation_entry.h" 24 #include "content/browser/tab_contents/navigation_entry.h"
24 #include "content/browser/tab_contents/page_navigator.h" 25 #include "content/browser/tab_contents/page_navigator.h"
25 #include "content/browser/tab_contents/render_view_host_manager.h" 26 #include "content/browser/tab_contents/render_view_host_manager.h"
26 #include "content/browser/tab_contents/tab_contents_observer.h" 27 #include "content/browser/tab_contents/tab_contents_observer.h"
27 #include "content/browser/webui/web_ui.h" 28 #include "content/browser/webui/web_ui.h"
28 #include "content/common/property_bag.h" 29 #include "content/common/property_bag.h"
29 #include "content/common/renderer_preferences.h" 30 #include "content/common/renderer_preferences.h"
30 #include "net/base/load_states.h" 31 #include "net/base/load_states.h"
31 #include "ui/gfx/native_widget_types.h" 32 #include "ui/gfx/native_widget_types.h"
32 33
33 #if defined(OS_WIN) 34 #if defined(OS_WIN)
34 #include "base/win/scoped_handle.h" 35 #include "base/win/scoped_handle.h"
35 #endif 36 #endif
36 37
37 namespace gfx { 38 namespace gfx {
38 class Rect; 39 class Rect;
39 } 40 }
40 41
41 class DownloadItem; 42 class DownloadItem;
42 class LoadNotificationDetails; 43 class LoadNotificationDetails;
43 class Profile;
44 struct RendererPreferences; 44 struct RendererPreferences;
45 class RenderViewHost; 45 class RenderViewHost;
46 class SessionStorageNamespace; 46 class SessionStorageNamespace;
47 class SiteInstance; 47 class SiteInstance;
48 class SkBitmap; 48 class SkBitmap;
49 class TabContentsDelegate; 49 class TabContentsDelegate;
50 class TabContentsObserver; 50 class TabContentsObserver;
51 class TabContentsView; 51 class TabContentsView;
52 struct ThumbnailScore; 52 struct ThumbnailScore;
53 class URLPattern; 53 class URLPattern;
(...skipping 19 matching lines...) Expand all
73 INVALIDATE_TITLE = 1 << 4, // The title changed. 73 INVALIDATE_TITLE = 1 << 4, // The title changed.
74 }; 74 };
75 75
76 // |base_tab_contents| is used if we want to size the new tab contents view 76 // |base_tab_contents| is used if we want to size the new tab contents view
77 // based on an existing tab contents view. This can be NULL if not needed. 77 // based on an existing tab contents view. This can be NULL if not needed.
78 // 78 //
79 // The session storage namespace parameter allows multiple render views and 79 // The session storage namespace parameter allows multiple render views and
80 // tab contentses to share the same session storage (part of the WebStorage 80 // tab contentses to share the same session storage (part of the WebStorage
81 // spec) space. This is useful when restoring tabs, but most callers should 81 // spec) space. This is useful when restoring tabs, but most callers should
82 // pass in NULL which will cause a new SessionStorageNamespace to be created. 82 // pass in NULL which will cause a new SessionStorageNamespace to be created.
83 TabContents(Profile* profile, 83 TabContents(content::BrowserContext* browser_context,
84 SiteInstance* site_instance, 84 SiteInstance* site_instance,
85 int routing_id, 85 int routing_id,
86 const TabContents* base_tab_contents, 86 const TabContents* base_tab_contents,
87 SessionStorageNamespace* session_storage_namespace); 87 SessionStorageNamespace* session_storage_namespace);
88 virtual ~TabContents(); 88 virtual ~TabContents();
89 89
90 // Intrinsic tab state ------------------------------------------------------- 90 // Intrinsic tab state -------------------------------------------------------
91 91
92 // Returns the property bag for this tab contents, where callers can add 92 // Returns the property bag for this tab contents, where callers can add
93 // extra data they may wish to associate with the tab. Returns a pointer 93 // extra data they may wish to associate with the tab. Returns a pointer
94 // rather than a reference since the PropertyAccessors expect this. 94 // rather than a reference since the PropertyAccessors expect this.
95 const PropertyBag* property_bag() const { return &property_bag_; } 95 const PropertyBag* property_bag() const { return &property_bag_; }
96 PropertyBag* property_bag() { return &property_bag_; } 96 PropertyBag* property_bag() { return &property_bag_; }
97 97
98 TabContentsDelegate* delegate() const { return delegate_; } 98 TabContentsDelegate* delegate() const { return delegate_; }
99 void set_delegate(TabContentsDelegate* delegate); 99 void set_delegate(TabContentsDelegate* delegate);
100 100
101 // Gets the controller for this tab contents. 101 // Gets the controller for this tab contents.
102 NavigationController& controller() { return controller_; } 102 NavigationController& controller() { return controller_; }
103 const NavigationController& controller() const { return controller_; } 103 const NavigationController& controller() const { return controller_; }
104 104
105 // Returns the user profile associated with this TabContents (via the 105 // Returns the user context associated with this TabContents (via the
jam 2011/07/22 16:58:38 nit: browser_context
106 // NavigationController). 106 // NavigationController).
107 Profile* profile() const { return controller_.profile(); } 107 content::BrowserContext* browser_context() const {
108 return controller_.browser_context();
109 }
110
111 // Returns the profile.
112 // TEMPORARY; http://crbug.com/76788
113 Profile* profile() const { return static_cast<Profile*>(browser_context()); }
108 114
109 // Returns the SavePackage which manages the page saving job. May be NULL. 115 // Returns the SavePackage which manages the page saving job. May be NULL.
110 SavePackage* save_package() const { return save_package_.get(); } 116 SavePackage* save_package() const { return save_package_.get(); }
111 117
112 // Return the currently active RenderProcessHost and RenderViewHost. Each of 118 // Return the currently active RenderProcessHost and RenderViewHost. Each of
113 // these may change over time. 119 // these may change over time.
114 RenderProcessHost* GetRenderProcessHost() const; 120 RenderProcessHost* GetRenderProcessHost() const;
115 RenderViewHost* render_view_host() const { 121 RenderViewHost* render_view_host() const {
116 return render_manager_.current_host(); 122 return render_manager_.current_host();
117 } 123 }
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 virtual void RunJavaScriptMessage(const RenderViewHost* rvh, 662 virtual void RunJavaScriptMessage(const RenderViewHost* rvh,
657 const string16& message, 663 const string16& message,
658 const string16& default_prompt, 664 const string16& default_prompt,
659 const GURL& frame_url, 665 const GURL& frame_url,
660 const int flags, 666 const int flags,
661 IPC::Message* reply_msg, 667 IPC::Message* reply_msg,
662 bool* did_suppress_message) OVERRIDE; 668 bool* did_suppress_message) OVERRIDE;
663 virtual void RunBeforeUnloadConfirm(const RenderViewHost* rvh, 669 virtual void RunBeforeUnloadConfirm(const RenderViewHost* rvh,
664 const string16& message, 670 const string16& message,
665 IPC::Message* reply_msg); 671 IPC::Message* reply_msg);
666 virtual RendererPreferences GetRendererPrefs(Profile* profile) const; 672 virtual RendererPreferences GetRendererPrefs(
673 content::BrowserContext* context) const OVERRIDE;
jam 2011/07/22 16:58:38 nit: browser_context
667 virtual WebPreferences GetWebkitPrefs(); 674 virtual WebPreferences GetWebkitPrefs();
668 virtual void OnUserGesture(); 675 virtual void OnUserGesture();
669 virtual void OnIgnoredUIEvent(); 676 virtual void OnIgnoredUIEvent();
670 virtual void OnCrossSiteResponse(int new_render_process_host_id, 677 virtual void OnCrossSiteResponse(int new_render_process_host_id,
671 int new_request_id); 678 int new_request_id);
672 virtual void RendererUnresponsive(RenderViewHost* render_view_host, 679 virtual void RendererUnresponsive(RenderViewHost* render_view_host,
673 bool is_during_unload); 680 bool is_during_unload);
674 virtual void RendererResponsive(RenderViewHost* render_view_host); 681 virtual void RendererResponsive(RenderViewHost* render_view_host);
675 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state, 682 virtual void LoadStateChanged(const GURL& url, net::LoadState load_state,
676 uint64 upload_position, uint64 upload_size); 683 uint64 upload_position, uint64 upload_size);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 ObserverList<TabContentsObserver> observers_; 848 ObserverList<TabContentsObserver> observers_;
842 849
843 // Content restrictions, used to disable print/copy etc based on content's 850 // Content restrictions, used to disable print/copy etc based on content's
844 // (full-page plugins for now only) permissions. 851 // (full-page plugins for now only) permissions.
845 int content_restrictions_; 852 int content_restrictions_;
846 853
847 DISALLOW_COPY_AND_ASSIGN(TabContents); 854 DISALLOW_COPY_AND_ASSIGN(TabContents);
848 }; 855 };
849 856
850 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_ 857 #endif // CONTENT_BROWSER_TAB_CONTENTS_TAB_CONTENTS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698