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

Side by Side Diff: chrome/browser/ui/views/intent_picker_bubble_view.h

Issue 2335313003: Refactor IntentPickerBubbleView::ShowBubble() (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_UI_VIEWS_INTENT_PICKER_BUBBLE_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_INTENT_PICKER_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_INTENT_PICKER_BUBBLE_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_INTENT_PICKER_BUBBLE_VIEW_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "chrome/browser/chromeos/arc/arc_navigation_throttle.h" 13 #include "chrome/browser/chromeos/arc/arc_navigation_throttle.h"
14 #include "content/public/browser/web_contents_observer.h" 14 #include "content/public/browser/web_contents_observer.h"
15 #include "ui/gfx/image/image.h" 15 #include "ui/gfx/image/image.h"
16 #include "ui/views/bubble/bubble_dialog_delegate.h" 16 #include "ui/views/bubble/bubble_dialog_delegate.h"
17 #include "ui/views/controls/button/button.h" 17 #include "ui/views/controls/button/button.h"
18 18
19 namespace content { 19 namespace content {
20 class NavigationHandle;
21 class WebContents; 20 class WebContents;
22 } // namespace content 21 } // namespace content
23 22
24 namespace views { 23 namespace views {
25 class Label; 24 class Label;
26 class LabelButton; 25 class LabelButton;
27 class View; 26 class View;
28 class Widget; 27 class Widget;
29 } // namespace views 28 } // namespace views
30 29
(...skipping 23 matching lines...) Expand all
54 using NameAndIcon = arc::ArcNavigationThrottle::NameAndIcon; 53 using NameAndIcon = arc::ArcNavigationThrottle::NameAndIcon;
55 // This callback informs the index of the app selected by the user, along with 54 // This callback informs the index of the app selected by the user, along with
56 // the reason why the Bubble was closed. The size_t param must have a value in 55 // the reason why the Bubble was closed. The size_t param must have a value in
57 // the range [0, app_info.size()-1], except when the CloseReason is ERROR or 56 // the range [0, app_info.size()-1], except when the CloseReason is ERROR or
58 // DIALOG_DEACTIVATED, for these cases we return a dummy value 57 // DIALOG_DEACTIVATED, for these cases we return a dummy value
59 // |kAppTagNoneSelected| which won't be used at all and has no significance. 58 // |kAppTagNoneSelected| which won't be used at all and has no significance.
60 using ThrottleCallback = 59 using ThrottleCallback =
61 base::Callback<void(size_t, arc::ArcNavigationThrottle::CloseReason)>; 60 base::Callback<void(size_t, arc::ArcNavigationThrottle::CloseReason)>;
62 61
63 ~IntentPickerBubbleView() override; 62 ~IntentPickerBubbleView() override;
64 static void ShowBubble(content::NavigationHandle* handle, 63 static void ShowBubble(content::WebContents* contents,
djacobo_ 2016/09/14 17:16:56 nit: same here, let's go either |contents| or |web
Yusuke Sato 2016/09/14 18:15:55 Done.
65 const std::vector<NameAndIcon>& app_info, 64 const std::vector<NameAndIcon>& app_info,
66 const ThrottleCallback& throttle_cb); 65 const ThrottleCallback& throttle_cb);
67 static std::unique_ptr<IntentPickerBubbleView> CreateBubbleView( 66 static std::unique_ptr<IntentPickerBubbleView> CreateBubbleView(
68 const std::vector<NameAndIcon>& app_info, 67 const std::vector<NameAndIcon>& app_info,
69 const ThrottleCallback& throttle_cb, 68 const ThrottleCallback& throttle_cb,
70 content::WebContents* web_contents); 69 content::WebContents* web_contents);
71 70
72 protected: 71 protected:
73 // views::BubbleDialogDelegateView overrides: 72 // views::BubbleDialogDelegateView overrides:
74 void Init() override; 73 void Init() override;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 views::LabelButton* always_button_; 112 views::LabelButton* always_button_;
114 views::LabelButton* just_once_button_; 113 views::LabelButton* just_once_button_;
115 views::ScrollView* scroll_view_; 114 views::ScrollView* scroll_view_;
116 115
117 std::vector<NameAndIcon> app_info_; 116 std::vector<NameAndIcon> app_info_;
118 117
119 DISALLOW_COPY_AND_ASSIGN(IntentPickerBubbleView); 118 DISALLOW_COPY_AND_ASSIGN(IntentPickerBubbleView);
120 }; 119 };
121 120
122 #endif // CHROME_BROWSER_UI_VIEWS_INTENT_PICKER_BUBBLE_VIEW_H_ 121 #endif // CHROME_BROWSER_UI_VIEWS_INTENT_PICKER_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698