Chromium Code Reviews| 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" |
| 11 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "chrome/browser/ui/bookmarks/recently_used_folders_combo_model.h" | 14 #include "chrome/browser/ui/bookmarks/recently_used_folders_combo_model.h" |
| 15 #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h" | 15 #include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h" |
| 16 #include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view .h" | 16 #include "chrome/browser/ui/views/location_bar/location_bar_bubble_delegate_view .h" |
| 17 #include "ui/views/controls/button/button.h" | 17 #include "ui/views/controls/button/button.h" |
| 18 #include "ui/views/controls/combobox/combobox_listener.h" | 18 #include "ui/views/controls/combobox/combobox_listener.h" |
| 19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
| 20 | 20 |
| 21 class Profile; | 21 class Profile; |
| 22 | 22 |
| 23 class DesktopIOSPromotionBubbleView; | |
| 24 | |
| 23 namespace bookmarks { | 25 namespace bookmarks { |
| 24 class BookmarkBubbleObserver; | 26 class BookmarkBubbleObserver; |
| 25 } | 27 } |
| 26 | 28 |
| 27 namespace views { | 29 namespace views { |
| 28 class LabelButton; | 30 class LabelButton; |
| 29 class Textfield; | 31 class Textfield; |
| 30 } | 32 } |
| 31 | 33 |
| 32 // BookmarkBubbleView is a view intended to be used as the content of an | 34 // BookmarkBubbleView is a view intended to be used as the content of an |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 53 | 55 |
| 54 static void Hide(); | 56 static void Hide(); |
| 55 | 57 |
| 56 static BookmarkBubbleView* bookmark_bubble() { return bookmark_bubble_; } | 58 static BookmarkBubbleView* bookmark_bubble() { return bookmark_bubble_; } |
| 57 | 59 |
| 58 ~BookmarkBubbleView() override; | 60 ~BookmarkBubbleView() override; |
| 59 | 61 |
| 60 // views::WidgetDelegate: | 62 // views::WidgetDelegate: |
| 61 void WindowClosing() override; | 63 void WindowClosing() override; |
| 62 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; | 64 bool AcceleratorPressed(const ui::Accelerator& accelerator) override; |
| 65 gfx::ImageSkia GetWindowIcon() override; | |
| 66 bool ShouldShowWindowIcon() const override; | |
| 63 | 67 |
| 64 protected: | 68 protected: |
| 65 // views::BubbleDialogDelegateView method. | 69 // views::BubbleDialogDelegateView method. |
| 66 void Init() override; | 70 void Init() override; |
| 67 base::string16 GetWindowTitle() const override; | 71 base::string16 GetWindowTitle() const override; |
| 68 | 72 |
| 69 private: | 73 private: |
| 70 friend class BookmarkBubbleViewTest; | 74 friend class BookmarkBubbleViewTest; |
| 71 FRIEND_TEST_ALL_PREFIXES(BookmarkBubbleViewTest, SyncPromoSignedIn); | 75 FRIEND_TEST_ALL_PREFIXES(BookmarkBubbleViewTest, SyncPromoSignedIn); |
| 72 FRIEND_TEST_ALL_PREFIXES(BookmarkBubbleViewTest, SyncPromoNotSignedIn); | 76 FRIEND_TEST_ALL_PREFIXES(BookmarkBubbleViewTest, SyncPromoNotSignedIn); |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 96 | 100 |
| 97 // Overridden from views::ComboboxListener: | 101 // Overridden from views::ComboboxListener: |
| 98 void OnPerformAction(views::Combobox* combobox) override; | 102 void OnPerformAction(views::Combobox* combobox) override; |
| 99 | 103 |
| 100 // Handle the message when the user presses a button. | 104 // Handle the message when the user presses a button. |
| 101 void HandleButtonPressed(views::Button* sender); | 105 void HandleButtonPressed(views::Button* sender); |
| 102 | 106 |
| 103 // Shows the BookmarkEditor. | 107 // Shows the BookmarkEditor. |
| 104 void ShowEditor(); | 108 void ShowEditor(); |
| 105 | 109 |
| 110 // Shows the iOS promotion. | |
| 111 void ShowIOSPromotion(); | |
| 112 | |
| 106 // Sets the title and parent of the node. | 113 // Sets the title and parent of the node. |
| 107 void ApplyEdits(); | 114 void ApplyEdits(); |
| 108 | 115 |
| 109 // The bookmark bubble, if we're showing one. | 116 // The bookmark bubble, if we're showing one. |
| 110 static BookmarkBubbleView* bookmark_bubble_; | 117 static BookmarkBubbleView* bookmark_bubble_; |
| 111 | 118 |
| 112 // Our observer, to notify when the bubble shows or hides. | 119 // Our observer, to notify when the bubble shows or hides. |
| 113 bookmarks::BookmarkBubbleObserver* observer_; | 120 bookmarks::BookmarkBubbleObserver* observer_; |
| 114 | 121 |
| 115 // Delegate, to handle clicks on the sign in link. | 122 // Delegate, to handle clicks on the sign in link. |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 135 // Button to close the window. | 142 // Button to close the window. |
| 136 views::LabelButton* close_button_; | 143 views::LabelButton* close_button_; |
| 137 | 144 |
| 138 // Textfield showing the title of the bookmark. | 145 // Textfield showing the title of the bookmark. |
| 139 views::Textfield* title_tf_; | 146 views::Textfield* title_tf_; |
| 140 | 147 |
| 141 // Combobox showing a handful of folders the user can choose from, including | 148 // Combobox showing a handful of folders the user can choose from, including |
| 142 // the current parent. | 149 // the current parent. |
| 143 views::Combobox* parent_combobox_; | 150 views::Combobox* parent_combobox_; |
| 144 | 151 |
| 152 // iOS promotion view. | |
| 153 DesktopIOSPromotionBubbleView* ios_promo_view_; | |
|
sky
2017/03/27 20:03:55
This is never initialized. I recommend initializin
mrefaat
2017/03/29 19:50:18
i added initialization on the constructor for cons
| |
| 154 | |
| 145 // When the destructor is invoked should the bookmark be removed? | 155 // When the destructor is invoked should the bookmark be removed? |
| 146 bool remove_bookmark_; | 156 bool remove_bookmark_; |
| 147 | 157 |
| 148 // When the destructor is invoked should edits be applied? | 158 // When the destructor is invoked should edits be applied? |
| 149 bool apply_edits_; | 159 bool apply_edits_; |
| 150 | 160 |
| 161 // Was the Windows to iOS promotion shown to the user. | |
| 162 bool ios_promotion_viewed_; | |
|
sky
2017/03/27 20:03:55
I think you want is_showing_ios_promotion_?
mrefaat
2017/03/29 19:50:18
Done.
| |
| 163 | |
| 151 DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleView); | 164 DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleView); |
| 152 }; | 165 }; |
| 153 | 166 |
| 154 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_ | 167 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_ |
| OLD | NEW |