Revert of [Extensions] Make extension message bubble factory platform-abstract (patchset #4 id:120001 of https://codereview.chromium.org/1078543002/)
Reason for revert:
Looks like this caused crbug.com/476426. Reverting to investigate.
Original issue's description:
> [Extensions] Make extension message bubble factory platform-abstract
>
> We want to show extension message bubbles on multiple platforms;
> the first step towards this is to make the bubble factory
> platform-abstract. Do so, and as an added bonus, shave off
> 200 lines of code.
>
> BUG=474092
>
> Committed: https://crrev.com/a9a17da0de2260f6cb1a10b542a6d3a2b5fbf504
> Cr-Commit-Position: refs/heads/master@{#324715}
[email protected],[email protected]
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=474092
Review URL: https://codereview.chromium.org/1081113002
Cr-Commit-Position: refs/heads/master@{#324876}
diff --git a/chrome/browser/extensions/extension_message_bubble_controller.cc b/chrome/browser/extensions/extension_message_bubble_controller.cc
index a30b1f07..778c7ad 100644
--- a/chrome/browser/extensions/extension_message_bubble_controller.cc
+++ b/chrome/browser/extensions/extension_message_bubble_controller.cc
@@ -8,7 +8,6 @@
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_message_bubble.h"
-#include "chrome/browser/extensions/extension_toolbar_model.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -123,15 +122,21 @@
bool ExtensionMessageBubbleController::CloseOnDeactivate() { return false; }
-void ExtensionMessageBubbleController::HighlightExtensionsIfNecessary() {
- if (delegate_->ShouldHighlightExtensions()) {
- const ExtensionIdList& extension_ids = GetExtensionIdList();
- DCHECK(!extension_ids.empty());
- ExtensionToolbarModel::Get(profile_)->HighlightExtensions(extension_ids);
- }
-}
-
void ExtensionMessageBubbleController::Show(ExtensionMessageBubble* bubble) {
+ // Wire up all the callbacks, to get notified what actions the user took.
+ base::Closure dismiss_button_callback =
+ base::Bind(&ExtensionMessageBubbleController::OnBubbleDismiss,
+ base::Unretained(this));
+ base::Closure action_button_callback =
+ base::Bind(&ExtensionMessageBubbleController::OnBubbleAction,
+ base::Unretained(this));
+ base::Closure link_callback =
+ base::Bind(&ExtensionMessageBubbleController::OnLinkClicked,
+ base::Unretained(this));
+ bubble->OnActionButtonClicked(action_button_callback);
+ bubble->OnDismissButtonClicked(dismiss_button_callback);
+ bubble->OnLinkClicked(link_callback);
+
bubble->Show();
}