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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 // Requests the renderer to exit fullscreen. | 653 // Requests the renderer to exit fullscreen. |
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 // Called when MediaSession changes any of its state. |
| 664 virtual void OnMediaSessionStateChanged() = 0; |
| 665 // Requests to resume the current media session. |
| 666 virtual void ResumeMediaSession() = 0; |
| 667 // Requests to suspend the current media session. |
| 668 virtual void SuspendMediaSession() = 0; |
| 669 |
663 #if defined(OS_ANDROID) | 670 #if defined(OS_ANDROID) |
664 CONTENT_EXPORT static WebContents* FromJavaWebContents( | 671 CONTENT_EXPORT static WebContents* FromJavaWebContents( |
665 jobject jweb_contents_android); | 672 jobject jweb_contents_android); |
666 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() = 0; | 673 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() = 0; |
667 #elif defined(OS_MACOSX) | 674 #elif defined(OS_MACOSX) |
668 // Allowing other views disables optimizations which assume that only a single | 675 // Allowing other views disables optimizations which assume that only a single |
669 // WebContents is present. | 676 // WebContents is present. |
670 virtual void SetAllowOtherViews(bool allow) = 0; | 677 virtual void SetAllowOtherViews(bool allow) = 0; |
671 | 678 |
672 // Returns true if other views are allowed, false otherwise. | 679 // Returns true if other views are allowed, false otherwise. |
673 virtual bool GetAllowOtherViews() = 0; | 680 virtual bool GetAllowOtherViews() = 0; |
674 #endif // OS_ANDROID | 681 #endif // OS_ANDROID |
675 | 682 |
676 private: | 683 private: |
677 // This interface should only be implemented inside content. | 684 // This interface should only be implemented inside content. |
678 friend class WebContentsImpl; | 685 friend class WebContentsImpl; |
679 WebContents() {} | 686 WebContents() {} |
680 }; | 687 }; |
681 | 688 |
682 } // namespace content | 689 } // namespace content |
683 | 690 |
684 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 691 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
OLD | NEW |