| 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 class InterstitialPage; | 50 class InterstitialPage; |
| 51 class PageState; | 51 class PageState; |
| 52 class RenderFrameHost; | 52 class RenderFrameHost; |
| 53 class RenderProcessHost; | 53 class RenderProcessHost; |
| 54 class RenderViewHost; | 54 class RenderViewHost; |
| 55 class RenderWidgetHostView; | 55 class RenderWidgetHostView; |
| 56 class SiteInstance; | 56 class SiteInstance; |
| 57 class WebContentsDelegate; | 57 class WebContentsDelegate; |
| 58 struct CustomContextMenuContext; | 58 struct CustomContextMenuContext; |
| 59 struct DropData; | 59 struct DropData; |
| 60 struct Manifest; |
| 60 struct RendererPreferences; | 61 struct RendererPreferences; |
| 61 | 62 |
| 62 // WebContents is the core class in content/. A WebContents renders web content | 63 // WebContents is the core class in content/. A WebContents renders web content |
| 63 // (usually HTML) in a rectangular area. | 64 // (usually HTML) in a rectangular area. |
| 64 // | 65 // |
| 65 // Instantiating one is simple: | 66 // Instantiating one is simple: |
| 66 // scoped_ptr<content::WebContents> web_contents( | 67 // scoped_ptr<content::WebContents> web_contents( |
| 67 // content::WebContents::Create( | 68 // content::WebContents::Create( |
| 68 // content::WebContents::CreateParams(browser_context))); | 69 // content::WebContents::CreateParams(browser_context))); |
| 69 // gfx::NativeView view = web_contents->GetNativeView(); | 70 // gfx::NativeView view = web_contents->GetNativeView(); |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 // Notifies the renderer that the user has closed the FindInPage window | 573 // Notifies the renderer that the user has closed the FindInPage window |
| 573 // (and what action to take regarding the selection). | 574 // (and what action to take regarding the selection). |
| 574 virtual void StopFinding(StopFindAction action) = 0; | 575 virtual void StopFinding(StopFindAction action) = 0; |
| 575 | 576 |
| 576 // Requests the renderer to insert CSS into the main frame's document. | 577 // Requests the renderer to insert CSS into the main frame's document. |
| 577 virtual void InsertCSS(const std::string& css) = 0; | 578 virtual void InsertCSS(const std::string& css) = 0; |
| 578 | 579 |
| 579 // Returns true if audio has recently been audible from the WebContents. | 580 // Returns true if audio has recently been audible from the WebContents. |
| 580 virtual bool WasRecentlyAudible() = 0; | 581 virtual bool WasRecentlyAudible() = 0; |
| 581 | 582 |
| 583 typedef base::Callback<void(const Manifest&)> GetManifestCallback; |
| 584 |
| 585 // Requests the Manifest of the main frame's document. |
| 586 virtual void GetManifest(const GetManifestCallback&) = 0; |
| 587 |
| 582 #if defined(OS_ANDROID) | 588 #if defined(OS_ANDROID) |
| 583 CONTENT_EXPORT static WebContents* FromJavaWebContents( | 589 CONTENT_EXPORT static WebContents* FromJavaWebContents( |
| 584 jobject jweb_contents_android); | 590 jobject jweb_contents_android); |
| 585 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() = 0; | 591 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() = 0; |
| 586 #elif defined(OS_MACOSX) | 592 #elif defined(OS_MACOSX) |
| 587 // Allowing other views disables optimizations which assume that only a single | 593 // Allowing other views disables optimizations which assume that only a single |
| 588 // WebContents is present. | 594 // WebContents is present. |
| 589 virtual void SetAllowOtherViews(bool allow) = 0; | 595 virtual void SetAllowOtherViews(bool allow) = 0; |
| 590 | 596 |
| 591 // Returns true if other views are allowed, false otherwise. | 597 // Returns true if other views are allowed, false otherwise. |
| 592 virtual bool GetAllowOtherViews() = 0; | 598 virtual bool GetAllowOtherViews() = 0; |
| 593 #endif // OS_ANDROID | 599 #endif // OS_ANDROID |
| 594 | 600 |
| 595 private: | 601 private: |
| 596 // This interface should only be implemented inside content. | 602 // This interface should only be implemented inside content. |
| 597 friend class WebContentsImpl; | 603 friend class WebContentsImpl; |
| 598 WebContents() {} | 604 WebContents() {} |
| 599 }; | 605 }; |
| 600 | 606 |
| 601 } // namespace content | 607 } // namespace content |
| 602 | 608 |
| 603 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 609 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| OLD | NEW |