Chromium Code Reviews| 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 d60b27b960cc304c4dbace88b83b171766cd7323..f796b03119a1e44ddda4520cdc1bc329f15096dc 100644 |
| --- a/chrome/browser/ui/toolbar/toolbar_actions_bar.cc |
| +++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.cc |
| @@ -571,7 +571,8 @@ void ToolbarActionsBar::AddObserver(ToolbarActionsBarObserver* observer) { |
| } |
| void ToolbarActionsBar::RemoveObserver(ToolbarActionsBarObserver* observer) { |
| - observers_.RemoveObserver(observer); |
| + if (observers_.HasObserver(observer)) |
|
msw
2016/07/26 19:59:31
Is something removing itself twice now? Can you fi
Devlin
2016/07/26 21:59:03
+1
takumif
2016/07/28 20:04:11
Done.
|
| + observers_.RemoveObserver(observer); |
| } |
| void ToolbarActionsBar::ShowToolbarActionBubble( |
| @@ -678,9 +679,11 @@ void ToolbarActionsBar::OnToolbarActionRemoved(const std::string& action_id) { |
| // because the icon is just going to get re-added to the same location. |
| // There is an exception if this is an off-the-record profile, and the |
| // extension is no longer incognito-enabled. |
| - if (!extensions::ExtensionSystem::Get(browser_->profile()) |
| - ->runtime_data() |
| - ->IsBeingUpgraded(action_id) || |
| + if (ComponentToolbarActionsFactory::GetInstance() |
|
msw
2016/07/26 19:59:31
Is this check actually necessary? Wouldn't IsBeing
Devlin
2016/07/26 21:59:02
Yes, it would. Please remove this check. Toolbar
takumif
2016/07/28 20:04:11
Okay. In MRActionUnitTest, runtime_data() here is
Devlin
2016/07/29 19:10:22
Call CreateExtensionService() on TestExtensionSyst
takumif
2016/08/02 04:58:41
Thanks, did that.
|
| + ->IsComponentActionId(action_id) || |
| + !extensions::ExtensionSystem::Get(browser_->profile()) |
| + ->runtime_data() |
| + ->IsBeingUpgraded(action_id) || |
| (browser_->profile()->IsOffTheRecord() && |
| !extensions::util::IsIncognitoEnabled(action_id, browser_->profile()))) { |
| if (toolbar_actions_.size() > model_->visible_icon_count()) { |