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

Side by Side Diff: chrome/browser/ui/gtk/location_bar_view_gtk.cc

Issue 10911105: Switch ScriptBadgeController and PageActionController to use WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 | Annotate | Revision Log
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/ui/gtk/location_bar_view_gtk.h" 5 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after
1074 1074
1075 page_action_views_[index]->TestActivatePageAction(); 1075 page_action_views_[index]->TestActivatePageAction();
1076 } 1076 }
1077 1077
1078 void LocationBarViewGtk::Observe(int type, 1078 void LocationBarViewGtk::Observe(int type,
1079 const content::NotificationSource& source, 1079 const content::NotificationSource& source,
1080 const content::NotificationDetails& details) { 1080 const content::NotificationDetails& details) {
1081 switch (type) { 1081 switch (type) {
1082 case chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED: { 1082 case chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED: {
1083 // Only update if the updated action box was for the active tab contents. 1083 // Only update if the updated action box was for the active tab contents.
1084 TabContents* target_tab = 1084 WebContents* target_tab = content::Details<WebContents>(details).ptr();
1085 content::Details<TabContents>(details).ptr(); 1085 if (target_tab == GetTabContents()->web_contents())
1086 if (target_tab == GetTabContents())
1087 UpdatePageActions(); 1086 UpdatePageActions();
1088 break; 1087 break;
1089 } 1088 }
1090 1089
1091 case chrome::NOTIFICATION_PREF_CHANGED: { 1090 case chrome::NOTIFICATION_PREF_CHANGED: {
1092 std::string* pref_name_in = content::Details<std::string>(details).ptr(); 1091 std::string* pref_name_in = content::Details<std::string>(details).ptr();
1093 DCHECK(pref_name_in); 1092 DCHECK(pref_name_in);
1094 1093
1095 if (*pref_name_in == prefs::kEditBookmarksEnabled) 1094 if (*pref_name_in == prefs::kEditBookmarksEnabled)
1096 UpdateStarIcon(); 1095 UpdateStarIcon();
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 } 2110 }
2112 2111
2113 void LocationBarViewGtk::PageActionViewGtk::InspectPopup( 2112 void LocationBarViewGtk::PageActionViewGtk::InspectPopup(
2114 ExtensionAction* action) { 2113 ExtensionAction* action) {
2115 ExtensionPopupGtk::Show( 2114 ExtensionPopupGtk::Show(
2116 action->GetPopupUrl(current_tab_id_), 2115 action->GetPopupUrl(current_tab_id_),
2117 owner_->browser_, 2116 owner_->browser_,
2118 event_box_.get(), 2117 event_box_.get(),
2119 ExtensionPopupGtk::SHOW_AND_INSPECT); 2118 ExtensionPopupGtk::SHOW_AND_INSPECT);
2120 } 2119 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698