| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // The WebContentsView will never change and is guaranteed non-NULL. | 166 // The WebContentsView will never change and is guaranteed non-NULL. |
| 167 virtual WebContentsView* GetView() const = 0; | 167 virtual WebContentsView* GetView() const = 0; |
| 168 | 168 |
| 169 // Create a WebUI page for the given url. In most cases, this doesn't need to | 169 // Create a WebUI page for the given url. In most cases, this doesn't need to |
| 170 // be called by embedders since content will create its own WebUI objects as | 170 // be called by embedders since content will create its own WebUI objects as |
| 171 // necessary. However if the embedder wants to create its own WebUI object and | 171 // necessary. However if the embedder wants to create its own WebUI object and |
| 172 // keep track of it manually, it can use this. | 172 // keep track of it manually, it can use this. |
| 173 virtual WebUI* CreateWebUI(const GURL& url) = 0; | 173 virtual WebUI* CreateWebUI(const GURL& url) = 0; |
| 174 | 174 |
| 175 // Returns the committed WebUI if one exists, otherwise the pending one. | 175 // Returns the committed WebUI if one exists, otherwise the pending one. |
| 176 // Callers who want to use the pending WebUI for the pending navigation entry | |
| 177 // should use GetWebUIForCurrentState instead. | |
| 178 virtual WebUI* GetWebUI() const = 0; | 176 virtual WebUI* GetWebUI() const = 0; |
| 179 virtual WebUI* GetCommittedWebUI() const = 0; | 177 virtual WebUI* GetCommittedWebUI() const = 0; |
| 180 | 178 |
| 181 // Allows overriding the user agent used for NavigationEntries it owns. | 179 // Allows overriding the user agent used for NavigationEntries it owns. |
| 182 virtual void SetUserAgentOverride(const std::string& override) = 0; | 180 virtual void SetUserAgentOverride(const std::string& override) = 0; |
| 183 virtual const std::string& GetUserAgentOverride() const = 0; | 181 virtual const std::string& GetUserAgentOverride() const = 0; |
| 184 | 182 |
| 185 // Tab navigation state ------------------------------------------------------ | 183 // Tab navigation state ------------------------------------------------------ |
| 186 | 184 |
| 187 // Returns the current navigation properties, which if a navigation is | 185 // Returns the current navigation properties, which if a navigation is |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 // Gets the minimum/maximum zoom percent. | 375 // Gets the minimum/maximum zoom percent. |
| 378 virtual int GetMinimumZoomPercent() const = 0; | 376 virtual int GetMinimumZoomPercent() const = 0; |
| 379 virtual int GetMaximumZoomPercent() const = 0; | 377 virtual int GetMaximumZoomPercent() const = 0; |
| 380 | 378 |
| 381 // Gets the preferred size of the contents. | 379 // Gets the preferred size of the contents. |
| 382 virtual gfx::Size GetPreferredSize() const = 0; | 380 virtual gfx::Size GetPreferredSize() const = 0; |
| 383 | 381 |
| 384 // Get the content restrictions (see content::ContentRestriction). | 382 // Get the content restrictions (see content::ContentRestriction). |
| 385 virtual int GetContentRestrictions() const = 0; | 383 virtual int GetContentRestrictions() const = 0; |
| 386 | 384 |
| 387 // Returns the WebUI for the current state of the tab. This will either be | |
| 388 // the pending WebUI, the committed WebUI, or NULL. | |
| 389 virtual WebUI* GetWebUIForCurrentState()= 0; | |
| 390 | |
| 391 // Called when the reponse to a pending mouse lock request has arrived. | 385 // Called when the reponse to a pending mouse lock request has arrived. |
| 392 // Returns true if |allowed| is true and the mouse has been successfully | 386 // Returns true if |allowed| is true and the mouse has been successfully |
| 393 // locked. | 387 // locked. |
| 394 virtual bool GotResponseToLockMouseRequest(bool allowed) = 0; | 388 virtual bool GotResponseToLockMouseRequest(bool allowed) = 0; |
| 395 | 389 |
| 396 // Called when the user has selected a color in the color chooser. | 390 // Called when the user has selected a color in the color chooser. |
| 397 virtual void DidChooseColorInColorChooser(int color_chooser_id, | 391 virtual void DidChooseColorInColorChooser(int color_chooser_id, |
| 398 SkColor color) = 0; | 392 SkColor color) = 0; |
| 399 | 393 |
| 400 // Called when the color chooser has ended. | 394 // Called when the color chooser has ended. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 428 | 422 |
| 429 private: | 423 private: |
| 430 // This interface should only be implemented inside content. | 424 // This interface should only be implemented inside content. |
| 431 friend class WebContentsImpl; | 425 friend class WebContentsImpl; |
| 432 WebContents() {} | 426 WebContents() {} |
| 433 }; | 427 }; |
| 434 | 428 |
| 435 } // namespace content | 429 } // namespace content |
| 436 | 430 |
| 437 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ | 431 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_H_ |
| OLD | NEW |