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

Unified Diff: chrome/browser/ui/toolbar/toolbar_actions_bar.cc

Issue 2076093004: [Extensions UI] Handle multiple warning bubbles racing to show (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win tests Created 4 years, 6 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
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_actions_bar.h ('k') | chrome/browser/ui/toolbar/toolbar_actions_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/toolbar_actions_bar.cc
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
index 1614dde673f615dc8427a2db051eb45f731165f2..d60b27b960cc304c4dbace88b83b171766cd7323 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc
@@ -20,7 +20,6 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/extensions/extension_action_view_controller.h"
#include "chrome/browser/ui/extensions/extension_message_bubble_bridge.h"
-#include "chrome/browser/ui/extensions/extension_message_bubble_factory.h"
#include "chrome/browser/ui/extensions/settings_api_bubble_helpers.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -387,14 +386,9 @@ void ToolbarActionsBar::CreateActions() {
should_check_extension_bubble_ = false;
// CreateActions() can be called as part of the browser window set up, which
// we need to let finish before showing the actions.
- std::unique_ptr<extensions::ExtensionMessageBubbleController> controller =
- ExtensionMessageBubbleFactory(browser_).GetController();
- if (controller) {
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(&ToolbarActionsBar::MaybeShowExtensionBubble,
- weak_ptr_factory_.GetWeakPtr(),
- base::Passed(std::move(controller))));
- }
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&ToolbarActionsBar::MaybeShowExtensionBubble,
+ weak_ptr_factory_.GetWeakPtr()));
}
}
@@ -603,11 +597,13 @@ void ToolbarActionsBar::ShowToolbarActionBubbleAsync(
base::Passed(std::move(bubble))));
}
-void ToolbarActionsBar::MaybeShowExtensionBubble(
- std::unique_ptr<extensions::ExtensionMessageBubbleController> controller) {
- if (!controller->ShouldShow())
+void ToolbarActionsBar::MaybeShowExtensionBubble() {
+ std::unique_ptr<extensions::ExtensionMessageBubbleController> controller =
+ model_->GetExtensionMessageBubbleController(browser_);
+ if (!controller)
return;
+ DCHECK(controller->ShouldShow());
controller->HighlightExtensionsIfNecessary(); // Safe to call multiple times.
// Not showing the bubble right away (during startup) has a few benefits:
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_actions_bar.h ('k') | chrome/browser/ui/toolbar/toolbar_actions_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698