Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6351)

Unified Diff: chrome/browser/ui/views/intent_picker_bubble_view.h

Issue 2229943003: Reusing Ok/Cancel buttons for intent picker (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Inner button class for hovering/selected/unselected effects Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/intent_picker_bubble_view.h
diff --git a/chrome/browser/ui/views/intent_picker_bubble_view.h b/chrome/browser/ui/views/intent_picker_bubble_view.h
index 36c0f475f94c0085f10cffd50f0c631aa88b11f2..e8567c812bf1f9e15a6d7b3b23f160327cb726e3 100644
--- a/chrome/browser/ui/views/intent_picker_bubble_view.h
+++ b/chrome/browser/ui/views/intent_picker_bubble_view.h
@@ -32,6 +32,8 @@ namespace ui {
class Event;
} // namespace ui
+class IntentPickerMenuButton;
+
// A bubble that displays a list of aplications (icons and names), after the
// list we show a pair of buttons which allow the user to remember the selection
// or not. This class comunicates the user's selection with a callback used by
@@ -69,10 +71,23 @@ class IntentPickerBubbleView : public views::BubbleDialogDelegateView,
const ThrottleCallback& throttle_cb,
content::WebContents* web_contents);
+ // views::DialogDelegate overrides:
+ bool Accept() override;
+ bool Cancel() override;
+ bool Close() override;
+ int GetDefaultDialogButton() const override;
+
protected:
// views::BubbleDialogDelegateView overrides:
void Init() override;
+ // views::DialogDelegate overrides:
+ bool IsDialogButtonEnabled(ui::DialogButton button) const override;
+
+ // views::WidgetDelegate overrides:
+ base::string16 GetWindowTitle() const override;
+ base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
+
private:
friend class IntentPickerBubbleViewTest;
FRIEND_TEST_ALL_PREFIXES(IntentPickerBubbleViewTest, NullIcons);
@@ -84,7 +99,6 @@ class IntentPickerBubbleView : public views::BubbleDialogDelegateView,
// views::BubbleDialogDelegateView overrides:
void OnWidgetDestroying(views::Widget* widget) override;
- int GetDialogButtons() const override;
// views::ButtonListener overrides:
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
@@ -95,14 +109,10 @@ class IntentPickerBubbleView : public views::BubbleDialogDelegateView,
// content::WebContentsObserver overrides:
void WebContentsDestroyed() override;
- // Retrieves the LabelButton* contained at position |index| from the internal
- // ScrollView.
- views::LabelButton* GetLabelButtonAt(size_t index);
- void SetLabelButtonBackgroundColor(size_t index, SkColor color);
-
- // Flag set to true iff the callback was Run at some previous step, used to
- // ensure we only use the callback once.
- bool was_callback_run_;
+ // Retrieves the IntentPickerMenuButton* contained at position |index| from
+ // the internal ScrollView.
+ IntentPickerMenuButton* GetIntentPickerMenuButtonAt(size_t index);
+ gfx::ImageSkia GetAppImageForTesting(size_t index);
// Callback used to respond to ArcNavigationThrottle.
ThrottleCallback throttle_cb_;
@@ -110,8 +120,6 @@ class IntentPickerBubbleView : public views::BubbleDialogDelegateView,
// Keeps a invalid value unless the user explicitly makes a decision.
size_t selected_app_tag_;
- views::LabelButton* always_button_;
- views::LabelButton* just_once_button_;
views::ScrollView* scroll_view_;
std::vector<NameAndIcon> app_info_;

Powered by Google App Engine
This is Rietveld 408576698