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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 // tab menu item...). This is false for actions that indirectly close the tab, | 554 // tab menu item...). This is false for actions that indirectly close the tab, |
555 // such as closing the window. The setter is maintained by TabStripModel, and | 555 // such as closing the window. The setter is maintained by TabStripModel, and |
556 // the getter only useful from within TAB_CLOSED notification | 556 // the getter only useful from within TAB_CLOSED notification |
557 virtual void SetClosedByUserGesture(bool value) = 0; | 557 virtual void SetClosedByUserGesture(bool value) = 0; |
558 virtual bool GetClosedByUserGesture() const = 0; | 558 virtual bool GetClosedByUserGesture() const = 0; |
559 | 559 |
560 // Opens view-source tab for this contents. | 560 // Opens view-source tab for this contents. |
561 virtual void ViewSource() = 0; | 561 virtual void ViewSource() = 0; |
562 | 562 |
563 virtual void ViewFrameSource(const GURL& url, | 563 virtual void ViewFrameSource(const GURL& url, |
564 const PageState& page_state)= 0; | 564 const PageState& page_state) = 0; |
565 | 565 |
566 // Gets the minimum/maximum zoom percent. | 566 // Gets the minimum/maximum zoom percent. |
567 virtual int GetMinimumZoomPercent() const = 0; | 567 virtual int GetMinimumZoomPercent() const = 0; |
568 virtual int GetMaximumZoomPercent() const = 0; | 568 virtual int GetMaximumZoomPercent() const = 0; |
569 | 569 |
570 // Set the renderer's page scale back to one. | 570 // Set the renderer's page scale back to one. |
571 virtual void ResetPageScale() = 0; | 571 virtual void ResetPageScale() = 0; |
572 | 572 |
573 // Gets the preferred size of the contents. | 573 // Gets the preferred size of the contents. |
574 virtual gfx::Size GetPreferredSize() const = 0; | 574 virtual gfx::Size GetPreferredSize() const = 0; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 virtual void ExitFullscreen() = 0; | 654 virtual void ExitFullscreen() = 0; |
655 | 655 |
656 // Unblocks requests from renderer for a newly created window. This is | 656 // Unblocks requests from renderer for a newly created window. This is |
657 // used in showCreatedWindow() or sometimes later in cases where | 657 // used in showCreatedWindow() or sometimes later in cases where |
658 // delegate->ShouldResumeRequestsForCreatedWindow() indicated the requests | 658 // delegate->ShouldResumeRequestsForCreatedWindow() indicated the requests |
659 // should not yet be resumed. Then the client is responsible for calling this | 659 // should not yet be resumed. Then the client is responsible for calling this |
660 // as soon as they are ready. | 660 // as soon as they are ready. |
661 virtual void ResumeLoadingCreatedWebContents() = 0; | 661 virtual void ResumeLoadingCreatedWebContents() = 0; |
662 | 662 |
663 #if defined(OS_ANDROID) | 663 #if defined(OS_ANDROID) |
| 664 // Requests to resume the current media session. |
| 665 virtual void ResumeMediaSession() = 0; |
| 666 // Requests to suspend the current media session. |
| 667 virtual void SuspendMediaSession() = 0; |
| 668 |
664 CONTENT_EXPORT static WebContents* FromJavaWebContents( | 669 CONTENT_EXPORT static WebContents* FromJavaWebContents( |
665 jobject jweb_contents_android); | 670 jobject jweb_contents_android); |
666 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() = 0; | 671 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() = 0; |
667 #elif defined(OS_MACOSX) | 672 #elif defined(OS_MACOSX) |
668 // Allowing other views disables optimizations which assume that only a single | 673 // Allowing other views disables optimizations which assume that only a single |
669 // WebContents is present. | 674 // WebContents is present. |
670 virtual void SetAllowOtherViews(bool allow) = 0; | 675 virtual void SetAllowOtherViews(bool allow) = 0; |
671 | 676 |
672 // Returns true if other views are allowed, false otherwise. | 677 // Returns true if other views are allowed, false otherwise. |
673 virtual bool GetAllowOtherViews() = 0; | 678 virtual bool GetAllowOtherViews() = 0; |
674 #endif // OS_ANDROID | 679 #endif // OS_ANDROID |
675 | 680 |
676 private: | 681 private: |
677 // This interface should only be implemented inside content. | 682 // This interface should only be implemented inside content. |
678 friend class WebContentsImpl; | 683 friend class WebContentsImpl; |
679 WebContents() {} | 684 WebContents() {} |
680 }; | 685 }; |
681 | 686 |
682 } // namespace content | 687 } // namespace content |
683 | 688 |
684 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 689 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
OLD | NEW |