Index: chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h |
diff --git a/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h b/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h |
index 0bdb2d5ad22e9e41e719253d53d1a0df36a05c55..b3f04b6018b1a768b5d8c781b0b09375b67a96be 100644 |
--- a/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h |
+++ b/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h |
@@ -7,17 +7,11 @@ |
#include "base/basictypes.h" |
#include "base/strings/string16.h" |
-#include "chrome/browser/extensions/app_icon_loader.h" |
+#include "chrome/browser/ui/browser_window.h" |
#include "chrome/common/web_application_info.h" |
#include "ui/views/bubble/bubble_delegate.h" |
#include "ui/views/controls/button/button.h" |
-class Profile; |
- |
-namespace extensions { |
-class AppIconLoader; |
-} |
- |
namespace gfx { |
class ImageSkia; |
} |
@@ -30,26 +24,25 @@ class Textfield; |
} |
// BookmarkAppBubbleView is a view intended to be used as the content of a |
-// Bubble. BookmarkAppBubbleView provides views for editing the bookmark app it |
-// is created with. Don't create a BookmarkAppBubbleView directly, instead use |
-// the static ShowBubble method. |
+// Bubble. BookmarkAppBubbleView provides views for editing the details to |
+// create a bookmark app with. Don't create a BookmarkAppBubbleView directly, |
+// instead use the static ShowBubble method. |
class BookmarkAppBubbleView : public views::BubbleDelegateView, |
- public views::ButtonListener, |
- public extensions::AppIconLoader::Delegate { |
+ public views::ButtonListener { |
public: |
~BookmarkAppBubbleView() override; |
- static void ShowBubble(views::View* anchor_view, |
- Profile* profile, |
- const WebApplicationInfo& web_app_info, |
- const std::string& extension_id); |
+ static void ShowBubble( |
+ views::View* anchor_view, |
+ const WebApplicationInfo& web_app_info, |
+ const BrowserWindow::ShowBookmarkAppBubbleCallback& callback); |
private: |
// Creates a BookmarkAppBubbleView. |
- BookmarkAppBubbleView(views::View* anchor_view, |
- Profile* profile, |
- const WebApplicationInfo& web_app_info, |
- const std::string& extension_id); |
+ BookmarkAppBubbleView( |
+ views::View* anchor_view, |
+ const WebApplicationInfo& web_app_info, |
+ const BrowserWindow::ShowBookmarkAppBubbleCallback& callback); |
// Overriden from views::BubbleDelegateView: |
void Init() override; |
@@ -66,26 +59,17 @@ class BookmarkAppBubbleView : public views::BubbleDelegateView, |
// Closes the bubble or opens the edit dialog. |
void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
- // Overridden from extensions::AppIconLoader::Delegate: |
- void SetAppImage(const std::string& id, const gfx::ImageSkia& image) override; |
- |
// Handle the message when the user presses a button. |
void HandleButtonPressed(views::Button* sender); |
- // Sets the title and launch type of the app. |
- void ApplyEdits(); |
+ // The WebApplicationInfo that the user is editing. |
+ WebApplicationInfo web_app_info_; |
- // The bookmark app bubble, if we're showing one. |
- static BookmarkAppBubbleView* bookmark_app_bubble_; |
+ // Whether the user has accepted the dialog. |
+ bool user_accepted_; |
- // The profile. |
- Profile* profile_; |
- |
- // The WebApplicationInfo being used to create the app. |
- const WebApplicationInfo web_app_info_; |
- |
- // The extension id of the bookmark app. |
- const std::string extension_id_; |
+ // The callback to be invoked when the dialog is completed. |
+ BrowserWindow::ShowBookmarkAppBubbleCallback callback_; |
// Button for removing the bookmark. |
views::LabelButton* add_button_; |
@@ -102,12 +86,6 @@ class BookmarkAppBubbleView : public views::BubbleDelegateView, |
// Image showing the icon of the app. |
views::ImageView* icon_image_view_; |
- // When the destructor is invoked should the app be removed? |
- bool remove_app_; |
- |
- // Used to load the icon. |
- scoped_ptr<extensions::AppIconLoader> app_icon_loader_; |
- |
DISALLOW_COPY_AND_ASSIGN(BookmarkAppBubbleView); |
}; |