Chromium Code Reviews| Index: components/autofill/core/browser/ui/save_card_bubble_controller.h |
| diff --git a/components/autofill/core/browser/ui/save_card_bubble_controller.h b/components/autofill/core/browser/ui/save_card_bubble_controller.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6aeb69ab2cba1501bf699948b8f48bd67d6ed8a8 |
| --- /dev/null |
| +++ b/components/autofill/core/browser/ui/save_card_bubble_controller.h |
| @@ -0,0 +1,48 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_UI_SAVE_CARD_BUBBLE_CONTROLLER_H_ |
| +#define COMPONENTS_AUTOFILL_CORE_BROWSER_UI_SAVE_CARD_BUBBLE_CONTROLLER_H_ |
|
Evan Stade
2015/10/16 01:20:44
I don't think this belongs in components as it won
Justin Donnelly
2015/10/19 17:39:08
It won't? Do you mean the save card UI would have
bondd
2015/10/22 02:15:17
Yes, it seems to me we will use this class on iOS.
Justin Donnelly
2015/10/23 13:53:09
Evan, you never answered this question. I'm pretty
Evan Stade
2015/10/23 17:36:14
ios plans to have a bubble? Does ios Chrome have t
Justin Donnelly
2015/10/23 17:41:09
Fair enough.
|
| + |
| +#include "base/callback.h" |
| + |
| +namespace autofill { |
| + |
| +class SaveCardBubbleView; |
| + |
| +// Interface for per-tab class to control the save credit card bubble and |
| +// Omnibox icon. |
| +class SaveCardBubbleController { |
|
Evan Stade
2015/10/16 01:20:44
only the methods visible/used by the view should b
bondd
2015/10/22 02:15:17
Done.
|
| + public: |
| + // |save_card_callback| will be invoked if/when the Save button is pressed. |
| + virtual void CreateBubble(const base::Closure& save_card_callback) = 0; |
| + |
| + // CreateBubble() must be called first. |
| + virtual void ShowBubble() = 0; |
| + |
| + // Functions called by SaveCardBubbleView. |
| + virtual void OnSaveButton() = 0; |
| + virtual void OnCancelButton() = 0; |
| + virtual void OnBubbleClosed() = 0; |
| + |
| + // Returns true if Omnibox save credit card icon should be visible. |
| + virtual bool IsIconVisible() const = 0; |
| + |
| + // Returns true if Omnibox save credit card should be shown in its "toggled |
| + // on" state. |
| + virtual bool IsIconToggled() const = 0; |
| + |
| + // Returns nullptr if no bubble is currently shown. |
| + virtual SaveCardBubbleView* save_card_bubble_view() const = 0; |
| + |
| + protected: |
| + SaveCardBubbleController() {} |
| + virtual ~SaveCardBubbleController() {} |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); |
| +}; |
| + |
| +} // namespace autofill |
| + |
| +#endif // COMPONENTS_AUTOFILL_CORE_BROWSER_UI_SAVE_CARD_BUBBLE_CONTROLLER_H_ |