| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "base/supports_user_data.h" |
| 12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
| 13 #include "content/public/browser/navigation_controller.h" | 14 #include "content/public/browser/navigation_controller.h" |
| 14 #include "content/public/browser/page_navigator.h" | 15 #include "content/public/browser/page_navigator.h" |
| 15 #include "content/public/browser/save_page_type.h" | 16 #include "content/public/browser/save_page_type.h" |
| 16 #include "content/public/browser/web_ui.h" | 17 #include "content/public/browser/web_ui.h" |
| 17 #include "ipc/ipc_sender.h" | 18 #include "ipc/ipc_sender.h" |
| 18 #include "third_party/skia/include/core/SkColor.h" | 19 #include "third_party/skia/include/core/SkColor.h" |
| 19 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
| 20 #include "webkit/glue/window_open_disposition.h" | 21 #include "webkit/glue/window_open_disposition.h" |
| 21 | 22 |
| 22 namespace base { | 23 namespace base { |
| 23 class PropertyBag; | |
| 24 class TimeTicks; | 24 class TimeTicks; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace gfx { | 27 namespace gfx { |
| 28 class Rect; | 28 class Rect; |
| 29 class Size; | 29 class Size; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace net { | 32 namespace net { |
| 33 struct LoadStateWithParam; | 33 struct LoadStateWithParam; |
| 34 } | 34 } |
| 35 | 35 |
| 36 namespace content { | 36 namespace content { |
| 37 | 37 |
| 38 class BrowserContext; | 38 class BrowserContext; |
| 39 class InterstitialPage; | 39 class InterstitialPage; |
| 40 class RenderProcessHost; | 40 class RenderProcessHost; |
| 41 class RenderViewHost; | 41 class RenderViewHost; |
| 42 class RenderWidgetHostView; | 42 class RenderWidgetHostView; |
| 43 class SiteInstance; | 43 class SiteInstance; |
| 44 class WebContentsDelegate; | 44 class WebContentsDelegate; |
| 45 class WebContentsView; | 45 class WebContentsView; |
| 46 struct RendererPreferences; | 46 struct RendererPreferences; |
| 47 | 47 |
| 48 // Describes what goes in the main content area of a tab. | 48 // Describes what goes in the main content area of a tab. |
| 49 class WebContents : public PageNavigator, public IPC::Sender { | 49 class WebContents : public PageNavigator, |
| 50 public IPC::Sender, |
| 51 public base::SupportsUserData { |
| 50 public: | 52 public: |
| 51 // |base_web_contents| is used if we want to size the new WebContents's view | 53 // |base_web_contents| is used if we want to size the new WebContents's view |
| 52 // based on the view of an existing WebContents. This can be NULL if not | 54 // based on the view of an existing WebContents. This can be NULL if not |
| 53 // needed. | 55 // needed. |
| 54 CONTENT_EXPORT static WebContents* Create( | 56 CONTENT_EXPORT static WebContents* Create( |
| 55 BrowserContext* browser_context, | 57 BrowserContext* browser_context, |
| 56 SiteInstance* site_instance, | 58 SiteInstance* site_instance, |
| 57 int routing_id, | 59 int routing_id, |
| 58 const WebContents* base_web_contents); | 60 const WebContents* base_web_contents); |
| 59 | 61 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 76 | 78 |
| 77 // Returns a WebContents that wraps the RenderViewHost, or NULL if the | 79 // Returns a WebContents that wraps the RenderViewHost, or NULL if the |
| 78 // render view host's delegate isn't a WebContents. | 80 // render view host's delegate isn't a WebContents. |
| 79 CONTENT_EXPORT static WebContents* FromRenderViewHost( | 81 CONTENT_EXPORT static WebContents* FromRenderViewHost( |
| 80 const RenderViewHost* rvh); | 82 const RenderViewHost* rvh); |
| 81 | 83 |
| 82 virtual ~WebContents() {} | 84 virtual ~WebContents() {} |
| 83 | 85 |
| 84 // Intrinsic tab state ------------------------------------------------------- | 86 // Intrinsic tab state ------------------------------------------------------- |
| 85 | 87 |
| 86 // Returns the property bag for this WebContents, where callers can add | |
| 87 // extra data they may wish to associate with the tab. Returns a pointer | |
| 88 // rather than a reference since the PropertyAccessors expect this. | |
| 89 virtual const base::PropertyBag* GetPropertyBag() const = 0; | |
| 90 virtual base::PropertyBag* GetPropertyBag() = 0; | |
| 91 | |
| 92 // Gets/Sets the delegate. | 88 // Gets/Sets the delegate. |
| 93 virtual WebContentsDelegate* GetDelegate() = 0; | 89 virtual WebContentsDelegate* GetDelegate() = 0; |
| 94 virtual void SetDelegate(WebContentsDelegate* delegate) = 0; | 90 virtual void SetDelegate(WebContentsDelegate* delegate) = 0; |
| 95 | 91 |
| 96 // Gets the controller for this WebContents. | 92 // Gets the controller for this WebContents. |
| 97 virtual NavigationController& GetController() = 0; | 93 virtual NavigationController& GetController() = 0; |
| 98 virtual const NavigationController& GetController() const = 0; | 94 virtual const NavigationController& GetController() const = 0; |
| 99 | 95 |
| 100 // Returns the user browser context associated with this WebContents (via the | 96 // Returns the user browser context associated with this WebContents (via the |
| 101 // NavigationController). | 97 // NavigationController). |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 // Focuses the location bar. | 389 // Focuses the location bar. |
| 394 virtual void SetFocusToLocationBar(bool select_all) = 0; | 390 virtual void SetFocusToLocationBar(bool select_all) = 0; |
| 395 | 391 |
| 396 // Does this have an opener associated with it? | 392 // Does this have an opener associated with it? |
| 397 virtual bool HasOpener() const = 0; | 393 virtual bool HasOpener() const = 0; |
| 398 }; | 394 }; |
| 399 | 395 |
| 400 } // namespace content | 396 } // namespace content |
| 401 | 397 |
| 402 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 398 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| OLD | NEW |