| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 public: | 513 public: |
| 514 // Forms fillable by Autocomplete have been detected in the page. | 514 // Forms fillable by Autocomplete have been detected in the page. |
| 515 virtual void FormSubmitted(const webkit_glue::FormData& form) = 0; | 515 virtual void FormSubmitted(const webkit_glue::FormData& form) = 0; |
| 516 | 516 |
| 517 // Called to retrieve a list of suggestions from the web database given | 517 // Called to retrieve a list of suggestions from the web database given |
| 518 // the name of the field |field_name| and what the user has already typed | 518 // the name of the field |field_name| and what the user has already typed |
| 519 // in the field |user_text|. Appeals to the database thread to perform the | 519 // in the field |user_text|. Appeals to the database thread to perform the |
| 520 // query. When the database thread is finished, the AutocompleteHistory | 520 // query. When the database thread is finished, the AutocompleteHistory |
| 521 // manager retrieves the calling RenderViewHost and then passes the vector | 521 // manager retrieves the calling RenderViewHost and then passes the vector |
| 522 // of suggestions to RenderViewHost::AutocompleteSuggestionsReturned. | 522 // of suggestions to RenderViewHost::AutocompleteSuggestionsReturned. |
| 523 // Returns true to indicate that FormFieldHistorySuggestionsReturned will be | 523 virtual void GetAutocompleteSuggestions(const string16& field_name, |
| 524 // called. | |
| 525 virtual bool GetAutocompleteSuggestions(int query_id, | |
| 526 const string16& field_name, | |
| 527 const string16& user_text) = 0; | 524 const string16& user_text) = 0; |
| 528 | 525 |
| 529 // Called when the user has indicated that she wants to remove the specified | 526 // Called when the user has indicated that she wants to remove the specified |
| 530 // Autocomplete suggestion from the database. | 527 // Autocomplete suggestion from the database. |
| 531 virtual void RemoveAutocompleteEntry(const string16& field_name, | 528 virtual void RemoveAutocompleteEntry(const string16& field_name, |
| 532 const string16& value) = 0; | 529 const string16& value) = 0; |
| 533 | 530 |
| 534 protected: | 531 protected: |
| 535 virtual ~Autocomplete() {} | 532 virtual ~Autocomplete() {} |
| 536 }; | 533 }; |
| 537 | 534 |
| 538 // AutoFill ------------------------------------------------------------------ | 535 // AutoFill ------------------------------------------------------------------ |
| 539 // Interface for AutoFill-related functions. | 536 // Interface for AutoFill-related functions. |
| 540 | 537 |
| 541 class AutoFill { | 538 class AutoFill { |
| 542 public: | 539 public: |
| 543 // Called when the user submits a form. | 540 // Called when the user submits a form. |
| 544 virtual void FormSubmitted(const webkit_glue::FormData& form) = 0; | 541 virtual void FormSubmitted(const webkit_glue::FormData& form) = 0; |
| 545 | 542 |
| 546 // Called when the frame has finished loading and there are forms in the | 543 // Called when the frame has finished loading and there are forms in the |
| 547 // frame. | 544 // frame. |
| 548 virtual void FormsSeen(const std::vector<webkit_glue::FormData>& forms) = 0; | 545 virtual void FormsSeen(const std::vector<webkit_glue::FormData>& forms) = 0; |
| 549 | 546 |
| 550 // Called to retrieve a list of AutoFill suggestions from the web database | 547 // Called to retrieve a list of AutoFill suggestions from the web database |
| 551 // given the name of the field and what the user has already typed in the | 548 // given the name of the field, whether it is autofilled, and what the user |
| 552 // field. |form_autofilled| is true if the form containing |field| has any | 549 // has already typed in it. If there is a warning to be returned to the |
| 553 // auto-filled fields. Returns true to indicate that | 550 // user, it is stored into |values|, with corresponding unique id -1. |
| 554 // RenderViewHost::AutoFillSuggestionsReturned has been called. | 551 // Returns true to indicate that RenderViewHost::AutoFillSuggestionsReturned |
| 555 virtual bool GetAutoFillSuggestions( | 552 // has been called. |
| 556 int query_id, | 553 virtual bool GetAutoFillSuggestions(bool field_autofilled, |
| 557 bool form_autofilled, | 554 const webkit_glue::FormField& field, |
| 558 const webkit_glue::FormField& field) = 0; | 555 bool autofill_disabled) = 0; |
| 559 | 556 |
| 560 // Called to fill the FormData object with AutoFill profile information that | 557 // Called to fill the FormData object with AutoFill profile information that |
| 561 // matches the |value|, |unique_id| key. Returns true to indicate that | 558 // matches the |value|, |unique_id| key. Returns true to indicate that |
| 562 // RenderViewHost::AutoFillFormDataFilled has been called. | 559 // RenderViewHost::AutoFillFormDataFilled has been called. |
| 563 virtual bool FillAutoFillFormData(int query_id, | 560 virtual bool FillAutoFillFormData(int query_id, |
| 564 const webkit_glue::FormData& form, | 561 const webkit_glue::FormData& form, |
| 565 int unique_id) = 0; | 562 int unique_id) = 0; |
| 566 | 563 |
| 567 // Called when the user selects the 'AutoFill Options...' suggestions in the | 564 // Called when the user selects the 'AutoFill Options...' suggestions in the |
| 568 // AutoFill popup. | 565 // AutoFill popup. |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 bool remember) {} | 858 bool remember) {} |
| 862 | 859 |
| 863 // Update the content restrictions, i.e. disable print/copy. | 860 // Update the content restrictions, i.e. disable print/copy. |
| 864 virtual void UpdateContentRestrictions(int restrictions) {} | 861 virtual void UpdateContentRestrictions(int restrictions) {} |
| 865 | 862 |
| 866 protected: | 863 protected: |
| 867 virtual ~RenderViewHostDelegate() {} | 864 virtual ~RenderViewHostDelegate() {} |
| 868 }; | 865 }; |
| 869 | 866 |
| 870 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ | 867 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_VIEW_HOST_DELEGATE_H_ |
| OLD | NEW |