| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" | 5 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 } | 642 } |
| 643 | 643 |
| 644 void ToolbarActionsModel::RemoveComponentAction(const std::string& action_id) { | 644 void ToolbarActionsModel::RemoveComponentAction(const std::string& action_id) { |
| 645 DCHECK(use_redesign_); | 645 DCHECK(use_redesign_); |
| 646 ToolbarItem component_item(action_id, COMPONENT_ACTION); | 646 ToolbarItem component_item(action_id, COMPONENT_ACTION); |
| 647 DCHECK(HasItem(component_item)); | 647 DCHECK(HasItem(component_item)); |
| 648 RemoveItem(component_item); | 648 RemoveItem(component_item); |
| 649 RemovePref(component_item); | 649 RemovePref(component_item); |
| 650 } | 650 } |
| 651 | 651 |
| 652 bool ToolbarActionsModel::ActionsInitialized() const { |
| 653 return actions_initialized_; |
| 654 } |
| 655 |
| 652 void ToolbarActionsModel::IncognitoPopulate() { | 656 void ToolbarActionsModel::IncognitoPopulate() { |
| 653 DCHECK(profile_->IsOffTheRecord()); | 657 DCHECK(profile_->IsOffTheRecord()); |
| 654 const ToolbarActionsModel* original_model = | 658 const ToolbarActionsModel* original_model = |
| 655 ToolbarActionsModel::Get(profile_->GetOriginalProfile()); | 659 ToolbarActionsModel::Get(profile_->GetOriginalProfile()); |
| 656 | 660 |
| 657 // Find the absolute value of the original model's count. | 661 // Find the absolute value of the original model's count. |
| 658 int original_visible = original_model->visible_icon_count(); | 662 int original_visible = original_model->visible_icon_count(); |
| 659 | 663 |
| 660 // In incognito mode, we show only those actions that are incognito-enabled | 664 // In incognito mode, we show only those actions that are incognito-enabled |
| 661 // Further, any actions that were overflowed in regular mode are still | 665 // Further, any actions that were overflowed in regular mode are still |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 prefs_->GetInteger(extensions::pref_names::kToolbarSize); | 849 prefs_->GetInteger(extensions::pref_names::kToolbarSize); |
| 846 if (saved_icon_count != visible_icon_count_) | 850 if (saved_icon_count != visible_icon_count_) |
| 847 SetVisibleIconCount(saved_icon_count); | 851 SetVisibleIconCount(saved_icon_count); |
| 848 } | 852 } |
| 849 } | 853 } |
| 850 | 854 |
| 851 const extensions::Extension* ToolbarActionsModel::GetExtensionById( | 855 const extensions::Extension* ToolbarActionsModel::GetExtensionById( |
| 852 const std::string& id) const { | 856 const std::string& id) const { |
| 853 return extension_registry_->enabled_extensions().GetByID(id); | 857 return extension_registry_->enabled_extensions().GetByID(id); |
| 854 } | 858 } |
| OLD | NEW |