| Index: chrome/browser/ui/toolbar/toolbar_actions_model.cc
|
| diff --git a/chrome/browser/ui/toolbar/toolbar_actions_model.cc b/chrome/browser/ui/toolbar/toolbar_actions_model.cc
|
| index b67889d913326aca3fbe598861b110f0d545477e..2af73b7dae6e92d1cf8703a40df258c7369febca 100644
|
| --- a/chrome/browser/ui/toolbar/toolbar_actions_model.cc
|
| +++ b/chrome/browser/ui/toolbar/toolbar_actions_model.cc
|
| @@ -327,10 +327,11 @@
|
| if (!ShouldAddExtension(extension))
|
| return;
|
|
|
| - AddItem(ToolbarItem(extension->id(), EXTENSION_ACTION));
|
| -}
|
| -
|
| -void ToolbarActionsModel::AddItem(const ToolbarItem& item) {
|
| + AddItem(ToolbarItem(extension->id(), EXTENSION_ACTION),
|
| + extensions::Manifest::IsComponentLocation(extension->location()));
|
| +}
|
| +
|
| +void ToolbarActionsModel::AddItem(const ToolbarItem& item, bool is_component) {
|
| // We only use AddItem() once the system is initialized.
|
| DCHECK(actions_initialized_);
|
|
|
| @@ -341,7 +342,7 @@
|
| // extensions go at their previous position.
|
| size_t new_index = 0;
|
| if (is_new_extension) {
|
| - new_index = visible_icon_count();
|
| + new_index = is_component ? 0 : visible_icon_count();
|
| // For the last-known position, we use the index of the extension that is
|
| // just before this extension, plus one. (Note that this isn't the same
|
| // as new_index + 1, because last_known_positions_ can include disabled
|
| @@ -631,7 +632,7 @@
|
| DCHECK(use_redesign_);
|
| ToolbarItem component_item(action_id, COMPONENT_ACTION);
|
| DCHECK(!HasItem(component_item));
|
| - AddItem(component_item);
|
| + AddItem(component_item, true);
|
| }
|
|
|
| void ToolbarActionsModel::RemoveComponentAction(const std::string& action_id) {
|
|
|