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

Side by Side Diff: chrome/browser/extensions/extension_toolbar_model.cc

Issue 982413002: base: Stop passing a non-const ref to ObserverListBase::Iterator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: observerref: fixwindowsbuild Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/animation/layer_animation_controller.cc ('k') | components/renderer_context_menu/render_view_context_menu_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698