| 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/extensions/extension_toolbar_model.h" | 5 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 if (toolbar_items()[i]->id() == id) | 648 if (toolbar_items()[i]->id() == id) |
| 649 return i; | 649 return i; |
| 650 } | 650 } |
| 651 return -1; | 651 return -1; |
| 652 } | 652 } |
| 653 | 653 |
| 654 bool ExtensionToolbarModel::ShowExtensionActionPopup( | 654 bool ExtensionToolbarModel::ShowExtensionActionPopup( |
| 655 const Extension* extension, | 655 const Extension* extension, |
| 656 Browser* browser, | 656 Browser* browser, |
| 657 bool grant_active_tab) { | 657 bool grant_active_tab) { |
| 658 ObserverListBase<Observer>::Iterator it(observers_); | 658 ObserverListBase<Observer>::Iterator it(&observers_); |
| 659 Observer* obs = NULL; | 659 Observer* obs = NULL; |
| 660 // Look for the Observer associated with the browser. | 660 // Look for the Observer associated with the browser. |
| 661 // This would be cleaner if we had an abstract class for the Toolbar UI | 661 // This would be cleaner if we had an abstract class for the Toolbar UI |
| 662 // (like we do for LocationBar), but sadly, we don't. | 662 // (like we do for LocationBar), but sadly, we don't. |
| 663 while ((obs = it.GetNext()) != NULL) { | 663 while ((obs = it.GetNext()) != NULL) { |
| 664 if (obs->GetBrowser() == browser) | 664 if (obs->GetBrowser() == browser) |
| 665 return obs->ShowExtensionActionPopup(extension, grant_active_tab); | 665 return obs->ShowExtensionActionPopup(extension, grant_active_tab); |
| 666 } | 666 } |
| 667 return false; | 667 return false; |
| 668 } | 668 } |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 if (is_highlighting_) { | 733 if (is_highlighting_) { |
| 734 highlighted_items_.clear(); | 734 highlighted_items_.clear(); |
| 735 is_highlighting_ = false; | 735 is_highlighting_ = false; |
| 736 if (old_visible_icon_count_ != visible_icon_count_) | 736 if (old_visible_icon_count_ != visible_icon_count_) |
| 737 SetVisibleIconCount(old_visible_icon_count_); | 737 SetVisibleIconCount(old_visible_icon_count_); |
| 738 FOR_EACH_OBSERVER(Observer, observers_, ToolbarHighlightModeChanged(false)); | 738 FOR_EACH_OBSERVER(Observer, observers_, ToolbarHighlightModeChanged(false)); |
| 739 } | 739 } |
| 740 } | 740 } |
| 741 | 741 |
| 742 } // namespace extensions | 742 } // namespace extensions |
| OLD | NEW |