| Index: chrome/browser/ui/autofill/save_card_bubble_controller_impl.h
|
| diff --git a/chrome/browser/ui/autofill/save_card_bubble_controller_impl.h b/chrome/browser/ui/autofill/save_card_bubble_controller_impl.h
|
| index 921b0a647cde90a10586d726aefcae493f4b042e..d29b5c5097a05f3b0c95434f36aa47c550fbea30 100644
|
| --- a/chrome/browser/ui/autofill/save_card_bubble_controller_impl.h
|
| +++ b/chrome/browser/ui/autofill/save_card_bubble_controller_impl.h
|
| @@ -27,6 +27,35 @@ class SaveCardBubbleControllerImpl
|
| // |save_card_callback| will be invoked if/when the Save button is pressed.
|
| void SetCallback(const base::Closure& save_card_callback);
|
|
|
| + // Example of valid |lines| data:
|
| + // [ {
|
| + // "template" : "The legal documents are: {0} and {1}",
|
| + // "template_parameter" : [ {
|
| + // "display_text" : "Terms of Service",
|
| + // "url": "http://www.example.com/tos"
|
| + // }, {
|
| + // "display_text" : "Privacy Policy",
|
| + // "url": "http://www.example.com/pp"
|
| + // } ],
|
| + // }, {
|
| + // "template" : "This is the second line and it has no parameters"
|
| + // } ]
|
| + //
|
| + // Caveats:
|
| + // 1. '{' and '}' may be displayed by escaping them with an apostrophe in the
|
| + // template string, e.g. "template" : "Here is a literal '{'"
|
| + // 2. Two or more consecutive dollar signs in the template string will not
|
| + // expand correctly.
|
| + // 3. "${" anywhere in the template string is invalid.
|
| + // 4. "\n" embedded anywhere in the template string, or an empty template
|
| + // string, can be used to separate paragraphs. It is not possible to create
|
| + // a completely blank line by using two consecutive newlines (they will be
|
| + // treated as a single newline by views::StyledLabel).
|
| + //
|
| + // Returns false if contents of |lines| are invalid.
|
| + bool SetLegalMessage(const base::ListValue& lines);
|
| + void ClearLegalMessage();
|
| +
|
| // SetCallback() must be called first.
|
| void ShowBubble();
|
|
|
| @@ -44,8 +73,11 @@ class SaveCardBubbleControllerImpl
|
| void OnSaveButton() override;
|
| void OnCancelButton() override;
|
| void OnLearnMoreClicked() override;
|
| + void OnLegalMessageLinkClicked(const std::string& url) override;
|
| void OnBubbleClosed() override;
|
|
|
| + const std::vector<LegalMessageLine>& GetLegalMessageLines() const override;
|
| +
|
| private:
|
| friend class content::WebContentsUserData<SaveCardBubbleControllerImpl>;
|
|
|
| @@ -55,6 +87,8 @@ class SaveCardBubbleControllerImpl
|
| // Update the visibility and toggled state of the Omnibox save card icon.
|
| void UpdateIcon();
|
|
|
| + void OpenUrl(const std::string& url);
|
| +
|
| // content::WebContentsObserver:
|
| void DidNavigateMainFrame(
|
| const content::LoadCommittedDetails& details,
|
| @@ -68,6 +102,9 @@ class SaveCardBubbleControllerImpl
|
| // show and the icon is not visible.
|
| base::Closure save_card_callback_;
|
|
|
| + // If no legal message should be shown then this variable is an empty vector.
|
| + std::vector<LegalMessageLine> legal_message_lines_;
|
| +
|
| // Used to measure the amount of time on a page; if it's less than some
|
| // reasonable limit, then don't close the bubble upon navigation.
|
| scoped_ptr<base::ElapsedTimer> timer_;
|
|
|