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