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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 virtual const GURL& GetURL() const = 0; | 168 virtual const GURL& GetURL() const = 0; |
169 | 169 |
170 // Gets the URL currently being displayed in the URL bar, if there is one. | 170 // Gets the URL currently being displayed in the URL bar, if there is one. |
171 // This URL might be a pending navigation that hasn't committed yet, so it is | 171 // This URL might be a pending navigation that hasn't committed yet, so it is |
172 // not guaranteed to match the current page in this WebContents. A typical | 172 // not guaranteed to match the current page in this WebContents. A typical |
173 // example of this is interstitials, which show the URL of the new/loading | 173 // example of this is interstitials, which show the URL of the new/loading |
174 // page (active) but the security context is of the old page (last committed). | 174 // page (active) but the security context is of the old page (last committed). |
175 virtual const GURL& GetVisibleURL() const = 0; | 175 virtual const GURL& GetVisibleURL() const = 0; |
176 | 176 |
177 // Gets the last committed URL. It represents the current page that is | 177 // Gets the last committed URL. It represents the current page that is |
178 // displayed in this WebContents. It represents the current security | 178 // displayed in this WebContents. It represents the current security |
179 // context. | 179 // context. |
180 virtual const GURL& GetLastCommittedURL() const = 0; | 180 virtual const GURL& GetLastCommittedURL() const = 0; |
181 | 181 |
182 // Return the currently active RenderProcessHost and RenderViewHost. Each of | 182 // Return the currently active RenderProcessHost and RenderViewHost. Each of |
183 // these may change over time. | 183 // these may change over time. |
184 virtual RenderProcessHost* GetRenderProcessHost() const = 0; | 184 virtual RenderProcessHost* GetRenderProcessHost() const = 0; |
185 | 185 |
186 // Returns the main frame for the currently active view. | 186 // Returns the main frame for the currently active view. |
187 virtual RenderFrameHost* GetMainFrame() = 0; | 187 virtual RenderFrameHost* GetMainFrame() = 0; |
188 | 188 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 // Saves the given frame's URL to the local filesystem.. | 445 // Saves the given frame's URL to the local filesystem.. |
446 virtual void SaveFrame(const GURL& url, | 446 virtual void SaveFrame(const GURL& url, |
447 const Referrer& referrer) = 0; | 447 const Referrer& referrer) = 0; |
448 | 448 |
449 // Generate an MHTML representation of the current page in the given file. | 449 // Generate an MHTML representation of the current page in the given file. |
450 virtual void GenerateMHTML( | 450 virtual void GenerateMHTML( |
451 const base::FilePath& file, | 451 const base::FilePath& file, |
452 const base::Callback<void( | 452 const base::Callback<void( |
453 int64 /* size of the file */)>& callback) = 0; | 453 int64 /* size of the file */)>& callback) = 0; |
454 | 454 |
455 // Returns true if the active NavigationEntry's page_id equals page_id. | |
456 virtual bool IsActiveEntry(int32 page_id) = 0; | |
457 | |
458 // Returns the contents MIME type after a navigation. | 455 // Returns the contents MIME type after a navigation. |
459 virtual const std::string& GetContentsMimeType() const = 0; | 456 virtual const std::string& GetContentsMimeType() const = 0; |
460 | 457 |
461 // Returns true if this WebContents will notify about disconnection. | 458 // Returns true if this WebContents will notify about disconnection. |
462 virtual bool WillNotifyDisconnection() const = 0; | 459 virtual bool WillNotifyDisconnection() const = 0; |
463 | 460 |
464 // Override the encoding and reload the page by sending down | 461 // Override the encoding and reload the page by sending down |
465 // ViewMsg_SetPageEncoding to the renderer. |UpdateEncoding| is kinda | 462 // ViewMsg_SetPageEncoding to the renderer. |UpdateEncoding| is kinda |
466 // the opposite of this, by which 'browser' is notified of | 463 // the opposite of this, by which 'browser' is notified of |
467 // the encoding of the current tab from 'renderer' (determined by | 464 // the encoding of the current tab from 'renderer' (determined by |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 | 604 |
608 private: | 605 private: |
609 // This interface should only be implemented inside content. | 606 // This interface should only be implemented inside content. |
610 friend class WebContentsImpl; | 607 friend class WebContentsImpl; |
611 WebContents() {} | 608 WebContents() {} |
612 }; | 609 }; |
613 | 610 |
614 } // namespace content | 611 } // namespace content |
615 | 612 |
616 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 613 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
OLD | NEW |