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

Unified Diff: chrome/browser/ui/website_settings/chooser_bubble_delegate.h

Issue 1984923002: Refactor ChooserBubbleController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/website_settings/chooser_bubble_delegate.h
diff --git a/chrome/browser/ui/website_settings/chooser_bubble_delegate.h b/chrome/browser/ui/website_settings/chooser_bubble_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..bafc894c2a86aaf14d253150531a385f1126dde6
--- /dev/null
+++ b/chrome/browser/ui/website_settings/chooser_bubble_delegate.h
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_DELEGATE_H_
+#define CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_DELEGATE_H_
+
+#include "base/macros.h"
+#include "components/bubble/bubble_delegate.h"
+
+class Browser;
+class ChooserController;
+
+namespace content {
+class RenderFrameHost;
+}
+
+// ChooserBubbleDelegate overrides GetName() to identify the bubble
+// you define for collecting metrics. Create an instance of this
+// class and pass it to BubbleManager::ShowBubble() to show the bubble.
+class ChooserBubbleDelegate : public BubbleDelegate {
+ public:
+ explicit ChooserBubbleDelegate(
+ content::RenderFrameHost* owner,
+ std::unique_ptr<ChooserController> chooser_controller);
+ ~ChooserBubbleDelegate() override;
+
+ // BubbleDelegate:
+ std::string GetName() const override;
+ std::unique_ptr<BubbleUi> BuildBubbleUi() override;
+ const content::RenderFrameHost* OwningFrame() const override;
+
+ ChooserController* chooser_controller() const {
+ return chooser_controller_.get();
+ }
+
+ private:
+ const content::RenderFrameHost* const owning_frame_;
+ Browser* browser_;
+ std::unique_ptr<ChooserController> chooser_controller_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChooserBubbleDelegate);
+};
+
+#endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_CHOOSER_BUBBLE_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698