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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 8789018: Revert 113047 - Make ExtensionService use ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 | Annotate | Revision Log
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/views/location_bar/location_bar_view.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
6 6
7 #if defined(TOOLKIT_USES_GTK) 7 #if defined(TOOLKIT_USES_GTK)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 return; 918 return;
919 919
920 std::map<ExtensionAction*, bool> old_visibility; 920 std::map<ExtensionAction*, bool> old_visibility;
921 for (PageActionViews::const_iterator i(page_action_views_.begin()); 921 for (PageActionViews::const_iterator i(page_action_views_.begin());
922 i != page_action_views_.end(); ++i) 922 i != page_action_views_.end(); ++i)
923 old_visibility[(*i)->image_view()->page_action()] = (*i)->IsVisible(); 923 old_visibility[(*i)->image_view()->page_action()] = (*i)->IsVisible();
924 924
925 // Remember the previous visibility of the page actions so that we can 925 // Remember the previous visibility of the page actions so that we can
926 // notify when this changes. 926 // notify when this changes.
927 std::vector<ExtensionAction*> page_actions; 927 std::vector<ExtensionAction*> page_actions;
928 for (ExtensionSet::const_iterator it = service->extensions()->begin(); 928 for (size_t i = 0; i < service->extensions()->size(); ++i) {
929 it != service->extensions()->end(); ++it) { 929 if (service->extensions()->at(i)->page_action())
930 if ((*it)->page_action()) 930 page_actions.push_back(service->extensions()->at(i)->page_action());
931 page_actions.push_back((*it)->page_action());
932 } 931 }
933 932
934 // On startup we sometimes haven't loaded any extensions. This makes sure 933 // On startup we sometimes haven't loaded any extensions. This makes sure
935 // we catch up when the extensions (and any page actions) load. 934 // we catch up when the extensions (and any page actions) load.
936 if (page_actions.size() != page_action_views_.size()) { 935 if (page_actions.size() != page_action_views_.size()) {
937 DeletePageActionViews(); // Delete the old views (if any). 936 DeletePageActionViews(); // Delete the old views (if any).
938 937
939 page_action_views_.resize(page_actions.size()); 938 page_action_views_.resize(page_actions.size());
940 939
941 // Add the page actions in reverse order, so that the child views are 940 // Add the page actions in reverse order, so that the child views are
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 !suggested_text_view_->GetText().empty(); 1226 !suggested_text_view_->GetText().empty();
1228 } 1227 }
1229 1228
1230 #if !defined(USE_AURA) 1229 #if !defined(USE_AURA)
1231 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() { 1230 OmniboxViewWin* LocationBarView::GetOmniboxViewWin() {
1232 CHECK(!views::Widget::IsPureViews()); 1231 CHECK(!views::Widget::IsPureViews());
1233 return static_cast<OmniboxViewWin*>(location_entry_.get()); 1232 return static_cast<OmniboxViewWin*>(location_entry_.get());
1234 } 1233 }
1235 #endif 1234 #endif
1236 #endif 1235 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/browser_actions_container_browsertest.cc ('k') | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698