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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 // Create and add an ExtensionActionViewController for the extension. | 181 // Create and add an ExtensionActionViewController for the extension. |
182 result.reset(new ExtensionActionViewController( | 182 result.reset(new ExtensionActionViewController( |
183 extension, browser, | 183 extension, browser, |
184 extension_action_manager_->GetExtensionAction(*extension), bar)); | 184 extension_action_manager_->GetExtensionAction(*extension), bar)); |
185 break; | 185 break; |
186 } | 186 } |
187 case COMPONENT_ACTION: { | 187 case COMPONENT_ACTION: { |
188 DCHECK(use_redesign_); | 188 DCHECK(use_redesign_); |
189 result = ComponentToolbarActionsFactory::GetInstance() | 189 result = ComponentToolbarActionsFactory::GetInstance() |
190 ->GetComponentToolbarActionForId(item.id, browser) | 190 ->GetComponentToolbarActionForId(item.id, browser, bar) |
191 .Pass(); | 191 .Pass(); |
192 break; | 192 break; |
193 } | 193 } |
194 case UNKNOWN_ACTION: | 194 case UNKNOWN_ACTION: |
195 NOTREACHED(); // Should never have an UNKNOWN_ACTION in toolbar_items. | 195 NOTREACHED(); // Should never have an UNKNOWN_ACTION in toolbar_items. |
196 break; | 196 break; |
197 } | 197 } |
198 return result.Pass(); | 198 return result.Pass(); |
199 } | 199 } |
200 | 200 |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 return true; | 792 return true; |
793 } | 793 } |
794 } | 794 } |
795 return false; | 795 return false; |
796 } | 796 } |
797 | 797 |
798 const extensions::Extension* ToolbarActionsModel::GetExtensionById( | 798 const extensions::Extension* ToolbarActionsModel::GetExtensionById( |
799 const std::string& id) const { | 799 const std::string& id) const { |
800 return extension_registry_->enabled_extensions().GetByID(id); | 800 return extension_registry_->enabled_extensions().GetByID(id); |
801 } | 801 } |
OLD | NEW |