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_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 // This is optional for implementations of WebContentsDelegate; if the | 448 // This is optional for implementations of WebContentsDelegate; if the |
449 // delegate doesn't provide a size, the current WebContentsView's size will be | 449 // delegate doesn't provide a size, the current WebContentsView's size will be |
450 // used. | 450 // used. |
451 virtual gfx::Size GetSizeForNewRenderView( | 451 virtual gfx::Size GetSizeForNewRenderView( |
452 const WebContents* web_contents) const; | 452 const WebContents* web_contents) const; |
453 | 453 |
454 // Notification that validation of a form displayed by the |web_contents| | 454 // Notification that validation of a form displayed by the |web_contents| |
455 // has failed. There can only be one message per |web_contents| at a time. | 455 // has failed. There can only be one message per |web_contents| at a time. |
456 virtual void ShowValidationMessage(WebContents* web_contents, | 456 virtual void ShowValidationMessage(WebContents* web_contents, |
457 const gfx::Rect& anchor_in_root_view, | 457 const gfx::Rect& anchor_in_root_view, |
458 const string16& main_text, | 458 const base::string16& main_text, |
459 const string16& sub_text) {} | 459 const base::string16& sub_text) {} |
460 | 460 |
461 // Notification that the delegate should hide any showing form validation | 461 // Notification that the delegate should hide any showing form validation |
462 // message. | 462 // message. |
463 virtual void HideValidationMessage(WebContents* web_contents) {} | 463 virtual void HideValidationMessage(WebContents* web_contents) {} |
464 | 464 |
465 // Notification that the form element that triggered the validation failure | 465 // Notification that the form element that triggered the validation failure |
466 // has moved. | 466 // has moved. |
467 virtual void MoveValidationMessage(WebContents* web_contents, | 467 virtual void MoveValidationMessage(WebContents* web_contents, |
468 const gfx::Rect& anchor_in_root_view) {} | 468 const gfx::Rect& anchor_in_root_view) {} |
469 | 469 |
470 protected: | 470 protected: |
471 virtual ~WebContentsDelegate(); | 471 virtual ~WebContentsDelegate(); |
472 | 472 |
473 private: | 473 private: |
474 friend class WebContentsImpl; | 474 friend class WebContentsImpl; |
475 | 475 |
476 // Called when |this| becomes the WebContentsDelegate for |source|. | 476 // Called when |this| becomes the WebContentsDelegate for |source|. |
477 void Attach(WebContents* source); | 477 void Attach(WebContents* source); |
478 | 478 |
479 // Called when |this| is no longer the WebContentsDelegate for |source|. | 479 // Called when |this| is no longer the WebContentsDelegate for |source|. |
480 void Detach(WebContents* source); | 480 void Detach(WebContents* source); |
481 | 481 |
482 // The WebContents that this is currently a delegate for. | 482 // The WebContents that this is currently a delegate for. |
483 std::set<WebContents*> attached_contents_; | 483 std::set<WebContents*> attached_contents_; |
484 }; | 484 }; |
485 | 485 |
486 } // namespace content | 486 } // namespace content |
487 | 487 |
488 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ | 488 #endif // CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_DELEGATE_H_ |
OLD | NEW |