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

Issue 155514: Implement extension specific events (Closed)

Created:
11 years, 5 months ago by Finnur
Modified:
9 years, 6 months ago
CC:
chromium-reviews_googlegroups.com, darin (slow to review), Erik does not do reviews, brettw, jam, Ben Goodger (Google)
Visibility:
Public.

Description

EFD now notifies EPM of renderviews created, which in turn notifies the renderer of page actions that it knows about. Remove generic event "page-action-executed" in favor of page action specific event (sent as extension_id/page_action_id). In the bindings, we now setup events for each page action we know about so we can register for specific events, and not receive broadcast events from all page actions. To setup these events I added a GetCurrentPageActions() to extension_process_bindings.cc and a helper function GetCurrentExtensionId(). And, finally, I simplified the page action background page by removing the check to see if we are already subscribed to the feed (since we now support multiple feed readers, it doesn't make sense anymore to always check Google Reader). This check might make a comeback later in a different form. BUG=13936 TEST=The RSS sample extension should work as before. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=20714

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 10

Patch Set 3 : '' #

Patch Set 4 : '' #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -91 lines) Patch
M chrome/browser/extensions/extension_browser_event_router.h View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_browser_event_router.cc View 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_event_names.h View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_event_names.cc View 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_function_dispatcher.cc View 1 2 3 2 chunks +6 lines, -0 lines 1 comment Download
M chrome/browser/extensions/extension_process_manager.h View 1 2 3 3 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_process_manager.cc View 1 2 3 4 chunks +46 lines, -0 lines 0 comments Download
M chrome/browser/views/location_bar_view.cc View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/common/render_messages_internal.h View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/extension_process_bindings.h View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/renderer/extensions/extension_process_bindings.cc View 1 2 3 6 chunks +55 lines, -3 lines 4 comments Download
M chrome/renderer/render_thread.h View 4 chunks +5 lines, -3 lines 0 comments Download
M chrome/renderer/render_thread.cc View 3 chunks +9 lines, -1 line 0 comments Download
M chrome/renderer/renderer_resources.grd View 1 2 3 1 chunk +1 line, -1 line 1 comment Download
M chrome/renderer/resources/extension_process_bindings.js View 1 2 3 3 chunks +12 lines, -3 lines 2 comments Download
M chrome/test/data/extensions/samples/subscribe_page_action/background.html View 2 chunks +25 lines, -74 lines 0 comments Download
D chrome/test/data/extensions/samples/subscribe_page_action/feed-icon-16x16-subscribed.png View Binary file 0 comments Download
M chrome/test/data/extensions/samples/subscribe_page_action/manifest.json View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Finnur
11 years, 5 months ago (2009-07-14 18:42:04 UTC) #1
Matt Perry
http://codereview.chromium.org/155514/diff/1006/1013 File chrome/browser/extensions/extension_function_dispatcher.cc (right): http://codereview.chromium.org/155514/diff/1006/1013#newcode195 Line 195: epm->OnExtensionViewCreated(extension_id(), This name is misleading. The EFD doesn't ...
11 years, 5 months ago (2009-07-14 19:12:20 UTC) #2
Finnur
Please take another look. http://codereview.chromium.org/155514/diff/1006/1019 File chrome/renderer/renderer_resources.grd (right): http://codereview.chromium.org/155514/diff/1006/1019#newcode3 Line 3: without changes to the ...
11 years, 5 months ago (2009-07-14 21:09:26 UTC) #3
Matt Perry
LGTM, with a handful of nits. http://codereview.chromium.org/155514/diff/60/1066 File chrome/browser/extensions/extension_function_dispatcher.cc (right): http://codereview.chromium.org/155514/diff/60/1066#newcode196 Line 196: render_view_host->process()->pid()); indent ...
11 years, 5 months ago (2009-07-14 21:17:48 UTC) #4
Aaron Boodman
11 years, 5 months ago (2009-07-14 21:28:52 UTC) #5
http://codereview.chromium.org/155514/diff/60/1077
File chrome/renderer/resources/extension_process_bindings.js (right):

http://codereview.chromium.org/155514/diff/60/1077#newcode402
Line 402: function setupEventListeners(extensionId) {
Rename this to something like setupPageActionEvents?

http://codereview.chromium.org/155514/diff/60/1077#newcode405
Line 405: var eventName = extensionId + "/" + pageActions[i];
Nit: there's no block scope in JavaScript so this variable is really defined at
the same level as pageActions. Therefore the style is usually to declare it
there.

Powered by Google App Engine
This is Rietveld 408576698