OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 Profile* profile, | 60 Profile* profile, |
61 const GURL& url, | 61 const GURL& url, |
62 bool already_bookmarked); | 62 bool already_bookmarked); |
63 | 63 |
64 static void Hide(); | 64 static void Hide(); |
65 | 65 |
66 static BookmarkBubbleView* bookmark_bubble() { return bookmark_bubble_; } | 66 static BookmarkBubbleView* bookmark_bubble() { return bookmark_bubble_; } |
67 | 67 |
68 ~BookmarkBubbleView() override; | 68 ~BookmarkBubbleView() override; |
69 | 69 |
70 // views::WidgetDelegate: | 70 // views::LocationBarBubbleDelegateView: |
71 void WindowClosing() override; | 71 View* GetInitiallyFocusedView() override; |
72 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 72 base::string16 GetWindowTitle() const override; |
73 gfx::ImageSkia GetWindowIcon() override; | 73 gfx::ImageSkia GetWindowIcon() override; |
74 bool ShouldShowWindowIcon() const override; | 74 bool ShouldShowWindowIcon() const override; |
| 75 void WindowClosing() override; |
| 76 View* CreateFootnoteView() override; |
| 77 const char* GetClassName() const override; |
| 78 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 79 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; |
| 80 |
| 81 // views::ButtonListener: |
| 82 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 83 |
| 84 // views::ComboboxListener: |
| 85 void OnPerformAction(views::Combobox* combobox) override; |
| 86 |
| 87 // DesktopIOSPromotionFootnoteDelegate: |
| 88 void OnIOSPromotionFootnoteLinkClicked() override; |
75 | 89 |
76 protected: | 90 protected: |
77 // views::BubbleDialogDelegateView method. | 91 // views::LocationBarBubbleDelegateView: |
78 void Init() override; | 92 void Init() override; |
79 base::string16 GetWindowTitle() const override; | |
80 | 93 |
81 private: | 94 private: |
82 friend class BookmarkBubbleViewTest; | 95 friend class BookmarkBubbleViewTest; |
83 friend class BookmarkBubbleViewBrowserTest; | 96 friend class BookmarkBubbleViewBrowserTest; |
84 FRIEND_TEST_ALL_PREFIXES(BookmarkBubbleViewTest, SyncPromoSignedIn); | 97 FRIEND_TEST_ALL_PREFIXES(BookmarkBubbleViewTest, SyncPromoSignedIn); |
85 FRIEND_TEST_ALL_PREFIXES(BookmarkBubbleViewTest, SyncPromoNotSignedIn); | 98 FRIEND_TEST_ALL_PREFIXES(BookmarkBubbleViewTest, SyncPromoNotSignedIn); |
86 | 99 |
87 // views::BubbleDialogDelegateView: | |
88 const char* GetClassName() const override; | |
89 View* GetInitiallyFocusedView() override; | |
90 View* CreateFootnoteView() override; | |
91 | |
92 // Creates a BookmarkBubbleView. | 100 // Creates a BookmarkBubbleView. |
93 BookmarkBubbleView(views::View* anchor_view, | 101 BookmarkBubbleView(views::View* anchor_view, |
94 bookmarks::BookmarkBubbleObserver* observer, | 102 bookmarks::BookmarkBubbleObserver* observer, |
95 std::unique_ptr<BubbleSyncPromoDelegate> delegate, | 103 std::unique_ptr<BubbleSyncPromoDelegate> delegate, |
96 Profile* profile, | 104 Profile* profile, |
97 const GURL& url, | 105 const GURL& url, |
98 bool newly_bookmarked); | 106 bool newly_bookmarked); |
99 | 107 |
100 // Returns the title to display. | 108 // Returns the title to display. |
101 base::string16 GetTitle(); | 109 base::string16 GetTitle(); |
102 | 110 |
103 // Overridden from views::View: | |
104 void GetAccessibleNodeData(ui::AXNodeData* node_data) override; | |
105 | |
106 // Overridden from views::ButtonListener: | |
107 // Closes the bubble or opens the edit dialog. | |
108 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | |
109 | |
110 // Overridden from views::ComboboxListener: | |
111 void OnPerformAction(views::Combobox* combobox) override; | |
112 | |
113 // Handle the message when the user presses a button. | 111 // Handle the message when the user presses a button. |
114 void HandleButtonPressed(views::Button* sender); | 112 void HandleButtonPressed(views::Button* sender); |
115 | 113 |
116 // Shows the BookmarkEditor. | 114 // Shows the BookmarkEditor. |
117 void ShowEditor(); | 115 void ShowEditor(); |
118 | 116 |
119 // Sets the title and parent of the node. | 117 // Sets the title and parent of the node. |
120 void ApplyEdits(); | 118 void ApplyEdits(); |
121 | 119 |
122 // DesktopIOSPromotionFootnoteDelegate : | |
123 void OnIOSPromotionFootnoteLinkClicked() override; | |
124 | |
125 #if defined(OS_WIN) | 120 #if defined(OS_WIN) |
126 // Check eligiblity to showthe iOS promotion from a specific entry point. | 121 // Check eligiblity to showthe iOS promotion from a specific entry point. |
127 bool IsIOSPromotionEligible( | 122 bool IsIOSPromotionEligible( |
128 desktop_ios_promotion::PromotionEntryPoint entry_point); | 123 desktop_ios_promotion::PromotionEntryPoint entry_point); |
129 | 124 |
130 // Shows the iOS promotion. | 125 // Shows the iOS promotion. |
131 void ShowIOSPromotion(desktop_ios_promotion::PromotionEntryPoint entry_point); | 126 void ShowIOSPromotion(desktop_ios_promotion::PromotionEntryPoint entry_point); |
132 #endif | 127 #endif |
133 | 128 |
134 // The bookmark bubble, if we're showing one. | 129 // The bookmark bubble, if we're showing one. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 // When the destructor is invoked should edits be applied? | 178 // When the destructor is invoked should edits be applied? |
184 bool apply_edits_; | 179 bool apply_edits_; |
185 | 180 |
186 // Whether the Windows to iOS promotion is shown to the user. | 181 // Whether the Windows to iOS promotion is shown to the user. |
187 bool is_showing_ios_promotion_; | 182 bool is_showing_ios_promotion_; |
188 | 183 |
189 DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleView); | 184 DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleView); |
190 }; | 185 }; |
191 | 186 |
192 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_ | 187 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_ |
OLD | NEW |