| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" |
| 9 #include "base/string16.h" | 11 #include "base/string16.h" |
| 10 #include "chrome/browser/bookmarks/recently_used_folders_combo_model.h" | 12 #include "chrome/browser/bookmarks/recently_used_folders_combo_model.h" |
| 11 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 12 #include "ui/views/bubble/bubble_delegate.h" | 14 #include "ui/views/bubble/bubble_delegate.h" |
| 13 #include "views/controls/button/button.h" | 15 #include "views/controls/button/button.h" |
| 14 #include "views/controls/combobox/combobox.h" | 16 #include "views/controls/combobox/combobox_listener.h" |
| 15 #include "views/controls/link_listener.h" | 17 #include "views/controls/link_listener.h" |
| 16 | 18 |
| 17 class Profile; | 19 class Profile; |
| 18 | 20 |
| 19 namespace views { | 21 namespace views { |
| 20 class TextButton; | 22 class TextButton; |
| 21 class Textfield; | 23 class Textfield; |
| 22 } | 24 } |
| 23 | 25 |
| 24 // BookmarkBubbleView is a view intended to be used as the content of an | 26 // BookmarkBubbleView is a view intended to be used as the content of an |
| 25 // Bubble. BookmarkBubbleView provides views for unstarring and editing the | 27 // Bubble. BookmarkBubbleView provides views for unstarring and editing the |
| 26 // bookmark it is created with. Don't create a BookmarkBubbleView directly, | 28 // bookmark it is created with. Don't create a BookmarkBubbleView directly, |
| 27 // instead use the static Show method. | 29 // instead use the static Show method. |
| 28 class BookmarkBubbleView : public views::BubbleDelegateView, | 30 class BookmarkBubbleView : public views::BubbleDelegateView, |
| 29 public views::LinkListener, | 31 public views::LinkListener, |
| 30 public views::ButtonListener, | 32 public views::ButtonListener, |
| 31 public views::Combobox::Listener { | 33 public views::ComboboxListener { |
| 32 public: | 34 public: |
| 33 static void ShowBubble(views::View* anchor_view, | 35 static void ShowBubble(views::View* anchor_view, |
| 34 Profile* profile, | 36 Profile* profile, |
| 35 const GURL& url, | 37 const GURL& url, |
| 36 bool newly_bookmarked); | 38 bool newly_bookmarked); |
| 37 | 39 |
| 38 static bool IsShowing(); | 40 static bool IsShowing(); |
| 39 | 41 |
| 40 static void Hide(); | 42 static void Hide(); |
| 41 | 43 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 58 private: | 60 private: |
| 59 // Creates a BookmarkBubbleView. | 61 // Creates a BookmarkBubbleView. |
| 60 BookmarkBubbleView(views::View* anchor_view, | 62 BookmarkBubbleView(views::View* anchor_view, |
| 61 Profile* profile, | 63 Profile* profile, |
| 62 const GURL& url, | 64 const GURL& url, |
| 63 bool newly_bookmarked); | 65 bool newly_bookmarked); |
| 64 | 66 |
| 65 // Returns the title to display. | 67 // Returns the title to display. |
| 66 string16 GetTitle(); | 68 string16 GetTitle(); |
| 67 | 69 |
| 68 // views::LinkListener method, either unstars the item or shows the bookmark | 70 // Overridden from views::LinkListener: |
| 69 // editor (depending upon which link was clicked). | 71 // Either unstars the item or shows the bookmark editor (depending upon which |
| 72 // link was clicked). |
| 70 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 73 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; |
| 71 | 74 |
| 72 // ButtonListener method, closes the bubble or opens the edit dialog. | 75 // Overridden from views::ButtonListener: |
| 76 // Closes the bubble or opens the edit dialog. |
| 73 virtual void ButtonPressed(views::Button* sender, | 77 virtual void ButtonPressed(views::Button* sender, |
| 74 const views::Event& event) OVERRIDE; | 78 const views::Event& event) OVERRIDE; |
| 75 | 79 |
| 76 // Combobox::Listener method. Changes the parent of the bookmark. | 80 // Overridden from views::ComboboxListener: |
| 77 virtual void ItemChanged(views::Combobox* combobox, | 81 // Changes the parent of the bookmark. |
| 82 virtual void ItemChanged(views::Combobox* combo_box, |
| 78 int prev_index, | 83 int prev_index, |
| 79 int new_index) OVERRIDE; | 84 int new_index) OVERRIDE; |
| 80 | 85 |
| 81 // Handle the message when the user presses a button. | 86 // Handle the message when the user presses a button. |
| 82 void HandleButtonPressed(views::Button* sender); | 87 void HandleButtonPressed(views::Button* sender); |
| 83 | 88 |
| 84 // Shows the BookmarkEditor. | 89 // Shows the BookmarkEditor. |
| 85 void ShowEditor(); | 90 void ShowEditor(); |
| 86 | 91 |
| 87 // Sets the title and parent of the node. | 92 // Sets the title and parent of the node. |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 // When the destructor is invoked should the bookmark be removed? | 129 // When the destructor is invoked should the bookmark be removed? |
| 125 bool remove_bookmark_; | 130 bool remove_bookmark_; |
| 126 | 131 |
| 127 // When the destructor is invoked should edits be applied? | 132 // When the destructor is invoked should edits be applied? |
| 128 bool apply_edits_; | 133 bool apply_edits_; |
| 129 | 134 |
| 130 DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleView); | 135 DISALLOW_COPY_AND_ASSIGN(BookmarkBubbleView); |
| 131 }; | 136 }; |
| 132 | 137 |
| 133 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_ | 138 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_BUBBLE_VIEW_H_ |
| OLD | NEW |