| 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" |
| 11 #include "base/callback_forward.h" | 11 #include "base/callback_forward.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/process/kill.h" | 13 #include "base/process/kill.h" |
| 14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
| 15 #include "base/supports_user_data.h" | 15 #include "base/supports_user_data.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 #include "content/public/browser/navigation_controller.h" | 17 #include "content/public/browser/navigation_controller.h" |
| 18 #include "content/public/browser/page_navigator.h" | 18 #include "content/public/browser/page_navigator.h" |
| 19 #include "content/public/browser/save_page_type.h" | 19 #include "content/public/browser/save_page_type.h" |
| 20 #include "content/public/browser/web_ui.h" | 20 #include "content/public/browser/web_ui.h" |
| 21 #include "content/public/common/page_zoom.h" |
| 21 #include "content/public/common/stop_find_action.h" | 22 #include "content/public/common/stop_find_action.h" |
| 22 #include "ipc/ipc_sender.h" | 23 #include "ipc/ipc_sender.h" |
| 23 #include "third_party/skia/include/core/SkColor.h" | 24 #include "third_party/skia/include/core/SkColor.h" |
| 24 #include "ui/base/window_open_disposition.h" | 25 #include "ui/base/window_open_disposition.h" |
| 25 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
| 26 #include "ui/gfx/size.h" | 27 #include "ui/gfx/size.h" |
| 27 | 28 |
| 28 #if defined(OS_ANDROID) | 29 #if defined(OS_ANDROID) |
| 29 #include "base/android/scoped_java_ref.h" | 30 #include "base/android/scoped_java_ref.h" |
| 30 #endif | 31 #endif |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // bombing), see DownloadRequestLimiter for details. | 418 // bombing), see DownloadRequestLimiter for details. |
| 418 virtual void UserGestureDone() = 0; | 419 virtual void UserGestureDone() = 0; |
| 419 | 420 |
| 420 // Indicates if this tab was explicitly closed by the user (control-w, close | 421 // Indicates if this tab was explicitly closed by the user (control-w, close |
| 421 // tab menu item...). This is false for actions that indirectly close the tab, | 422 // tab menu item...). This is false for actions that indirectly close the tab, |
| 422 // such as closing the window. The setter is maintained by TabStripModel, and | 423 // such as closing the window. The setter is maintained by TabStripModel, and |
| 423 // the getter only useful from within TAB_CLOSED notification | 424 // the getter only useful from within TAB_CLOSED notification |
| 424 virtual void SetClosedByUserGesture(bool value) = 0; | 425 virtual void SetClosedByUserGesture(bool value) = 0; |
| 425 virtual bool GetClosedByUserGesture() const = 0; | 426 virtual bool GetClosedByUserGesture() const = 0; |
| 426 | 427 |
| 428 // Gets the flag indicating whether zooming will have default behavior. |
| 429 virtual ZoomMode GetZoomMode() const = 0; |
| 430 |
| 427 // Gets the zoom level for this tab. | 431 // Gets the zoom level for this tab. |
| 428 virtual double GetZoomLevel() const = 0; | 432 virtual double GetZoomLevel() const = 0; |
| 429 | 433 |
| 430 // Gets the zoom percent for this tab. | 434 // Gets the zoom percent for this tab. |
| 431 virtual int GetZoomPercent(bool* enable_increment, | 435 virtual int GetZoomPercent(bool* enable_increment, |
| 432 bool* enable_decrement) const = 0; | 436 bool* enable_decrement) const = 0; |
| 433 | 437 |
| 434 // Opens view-source tab for this contents. | 438 // Opens view-source tab for this contents. |
| 435 virtual void ViewSource() = 0; | 439 virtual void ViewSource() = 0; |
| 436 | 440 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 bool is_favicon, | 491 bool is_favicon, |
| 488 uint32_t max_bitmap_size, | 492 uint32_t max_bitmap_size, |
| 489 const ImageDownloadCallback& callback) = 0; | 493 const ImageDownloadCallback& callback) = 0; |
| 490 | 494 |
| 491 // Returns true if the WebContents is responsible for displaying a subframe | 495 // Returns true if the WebContents is responsible for displaying a subframe |
| 492 // in a different process from its parent page. | 496 // in a different process from its parent page. |
| 493 // TODO: this doesn't really belong here. With site isolation, this should be | 497 // TODO: this doesn't really belong here. With site isolation, this should be |
| 494 // removed since we can then embed iframes in different processes. | 498 // removed since we can then embed iframes in different processes. |
| 495 virtual bool IsSubframe() const = 0; | 499 virtual bool IsSubframe() const = 0; |
| 496 | 500 |
| 501 // Sets the flag indicating whether zooming will have default behavior. |
| 502 virtual void SetZoomMode(ZoomMode mode) = 0; |
| 503 |
| 497 // Sets the zoom level for the current page and all BrowserPluginGuests | 504 // Sets the zoom level for the current page and all BrowserPluginGuests |
| 498 // within the page. | 505 // within the page. Returns the zoom_id of the zoom change. |
| 499 virtual void SetZoomLevel(double level) = 0; | 506 virtual int SetZoomLevel(double level) = 0; |
| 500 | 507 |
| 501 // Finds text on a page. | 508 // Finds text on a page. |
| 502 virtual void Find(int request_id, | 509 virtual void Find(int request_id, |
| 503 const base::string16& search_text, | 510 const base::string16& search_text, |
| 504 const blink::WebFindOptions& options) = 0; | 511 const blink::WebFindOptions& options) = 0; |
| 505 | 512 |
| 506 // Notifies the renderer that the user has closed the FindInPage window | 513 // Notifies the renderer that the user has closed the FindInPage window |
| 507 // (and what action to take regarding the selection). | 514 // (and what action to take regarding the selection). |
| 508 virtual void StopFinding(StopFindAction action) = 0; | 515 virtual void StopFinding(StopFindAction action) = 0; |
| 509 | 516 |
| 510 #if defined(OS_ANDROID) | 517 #if defined(OS_ANDROID) |
| 511 CONTENT_EXPORT static WebContents* FromJavaWebContents( | 518 CONTENT_EXPORT static WebContents* FromJavaWebContents( |
| 512 jobject jweb_contents_android); | 519 jobject jweb_contents_android); |
| 513 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() = 0; | 520 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaWebContents() = 0; |
| 514 #endif // OS_ANDROID | 521 #endif // OS_ANDROID |
| 515 | 522 |
| 516 private: | 523 private: |
| 517 // This interface should only be implemented inside content. | 524 // This interface should only be implemented inside content. |
| 518 friend class WebContentsImpl; | 525 friend class WebContentsImpl; |
| 519 WebContents() {} | 526 WebContents() {} |
| 520 }; | 527 }; |
| 521 | 528 |
| 522 } // namespace content | 529 } // namespace content |
| 523 | 530 |
| 524 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 531 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| OLD | NEW |