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

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

Issue 2155293002: Show the Cast toolbar icon ephemerally when Cast is in use (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Mark's comment, trybot failures, rebase Created 4 years, 4 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/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 2af73b7dae6e92d1cf8703a40df258c7369febca..b67889d913326aca3fbe598861b110f0d545477e 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_model.cc
+++ b/chrome/browser/ui/toolbar/toolbar_actions_model.cc
@@ -327,11 +327,10 @@ void ToolbarActionsModel::AddExtension(const extensions::Extension* extension) {
if (!ShouldAddExtension(extension))
return;
- AddItem(ToolbarItem(extension->id(), EXTENSION_ACTION),
- extensions::Manifest::IsComponentLocation(extension->location()));
+ AddItem(ToolbarItem(extension->id(), EXTENSION_ACTION));
}
-void ToolbarActionsModel::AddItem(const ToolbarItem& item, bool is_component) {
+void ToolbarActionsModel::AddItem(const ToolbarItem& item) {
// We only use AddItem() once the system is initialized.
DCHECK(actions_initialized_);
@@ -342,7 +341,7 @@ void ToolbarActionsModel::AddItem(const ToolbarItem& item, bool is_component) {
// extensions go at their previous position.
size_t new_index = 0;
if (is_new_extension) {
- new_index = is_component ? 0 : visible_icon_count();
+ new_index = 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
@@ -632,7 +631,7 @@ void ToolbarActionsModel::AddComponentAction(const std::string& action_id) {
DCHECK(use_redesign_);
ToolbarItem component_item(action_id, COMPONENT_ACTION);
DCHECK(!HasItem(component_item));
- AddItem(component_item, true);
+ AddItem(component_item);
}
void ToolbarActionsModel::RemoveComponentAction(const std::string& action_id) {
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_actions_model.h ('k') | chrome/browser/ui/toolbar/toolbar_actions_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698