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

Issue 174277: override chrome:// URLs via extensions. (Closed)

Created:
11 years, 4 months ago by Erik does not do reviews
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, Glen Murphy
Visibility:
Public.

Description

override chrome:// URLs via extensions. Overrides are declared in an extension's manifest. The last one installed wins. However, we keep a list of those installed per page so that priority is preserved and so that uninstall will revert to a previous state. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=24791

Patch Set 1 #

Patch Set 2 : cleanup #

Total comments: 3

Patch Set 3 : move file reading to file thread. handle override unregister. #

Total comments: 4

Patch Set 4 : take 2- this time using BrowserURLHandler #

Total comments: 9

Patch Set 5 : added unit test and made changes from review comments #

Patch Set 6 : only allow newtab to be overridden #

Patch Set 7 : fixed browser tests #

Patch Set 8 : fix ExtensionHost::GetBrowser() #

Patch Set 9 : fix linux errors #

Unified diffs Side-by-side diffs Delta from patch set Stats (+581 lines, -58 lines) Patch
M base/values.h View 1 1 chunk +7 lines, -2 lines 0 comments Download
M base/values.cc View 1 2 chunks +13 lines, -2 lines 0 comments Download
M chrome/browser/browser_about_handler.h View 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/browser_about_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/browser_prefs.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/browser_url_handler.h View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/browser_url_handler.cc View 3 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extension_apitest.h View 5 6 7 1 chunk +3 lines, -5 lines 0 comments Download
M chrome/browser/extensions/extension_apitest.cc View 5 6 7 8 2 chunks +34 lines, -21 lines 0 comments Download
M chrome/browser/extensions/extension_browsertest.cc View 5 6 2 chunks +13 lines, -10 lines 0 comments Download
M chrome/browser/extensions/extension_dom_ui.h View 4 3 chunks +34 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_dom_ui.cc View 4 3 chunks +216 lines, -6 lines 0 comments Download
M chrome/browser/extensions/extension_host.cc View 7 2 chunks +19 lines, -3 lines 0 comments Download
A chrome/browser/extensions/extension_override_apitest.cc View 5 1 chunk +13 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extensions_service.cc View 1 2 3 4 5 6 5 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/navigation_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome.gyp View 1 2 3 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/extension.h View 1 2 3 4 5 6 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension.cc View 1 2 3 4 5 6 1 chunk +31 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_constants.h View 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/common/extensions/extension_constants.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/common/notification_type.h View 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/override1/api_test.js View 5 6 7 1 chunk +107 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/override1/background.html View 1 chunk +2 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/override1/downloads.html View 1 chunk +6 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/override1/history.html View 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/override1/manifest.json View 5 1 chunk +12 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/override1/newtab.html View 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/override1/nonexistant.html View 1 chunk +4 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/override1/test.js View 5 6 7 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Erik does not do reviews
brettw: DOMUI stuff aa: extensions This isn't quite ready for submission. I have two important ...
11 years, 4 months ago (2009-08-22 00:00:48 UTC) #1
brettw
I think this looks like a good start. http://codereview.chromium.org/174277/diff/1001/1006 File chrome/browser/dom_ui/extension_override_ui.cc (right): http://codereview.chromium.org/174277/diff/1001/1006#newcode49 Line 49: ...
11 years, 4 months ago (2009-08-22 01:20:35 UTC) #2
Erik does not do reviews
http://codereview.chromium.org/174277/diff/1001/1006 File chrome/browser/dom_ui/extension_override_ui.cc (right): http://codereview.chromium.org/174277/diff/1001/1006#newcode61 Line 61: file_util::ReadFileToString(file_path, &file_contents); On 2009/08/22 01:20:35, brettw wrote: > ...
11 years, 4 months ago (2009-08-24 16:00:46 UTC) #3
brettw
On 2009/08/24 16:00:46, Erik Kay wrote: > http://codereview.chromium.org/174277/diff/1001/1006 > File chrome/browser/dom_ui/extension_override_ui.cc (right): > > http://codereview.chromium.org/174277/diff/1001/1006#newcode61 ...
11 years, 4 months ago (2009-08-24 16:14:10 UTC) #4
Erik does not do reviews
On 2009/08/24 16:14:10, brettw wrote: > On 2009/08/24 16:00:46, Erik Kay wrote: > > http://codereview.chromium.org/174277/diff/1001/1006 ...
11 years, 4 months ago (2009-08-24 17:39:35 UTC) #5
Aaron Boodman
http://codereview.chromium.org/174277/diff/1017/31 File chrome/browser/dom_ui/dom_ui_factory.cc (right): http://codereview.chromium.org/174277/diff/1017/31#newcode76 Line 76: if (ExtensionOverrideUI::CreateDOMUI(url, tab_contents, new_ui)) It doesn't look like ...
11 years, 4 months ago (2009-08-24 17:49:04 UTC) #6
brettw
http://codereview.chromium.org/174277/diff/1017/31 File chrome/browser/dom_ui/dom_ui_factory.cc (right): http://codereview.chromium.org/174277/diff/1017/31#newcode76 Line 76: if (ExtensionOverrideUI::CreateDOMUI(url, tab_contents, new_ui)) On 2009/08/24 17:49:04, Aaron ...
11 years, 4 months ago (2009-08-24 20:20:32 UTC) #7
Erik does not do reviews
I've changed the CL a fair amount. Rather than hooking into DOMUIFactory and using its ...
11 years, 4 months ago (2009-08-25 21:11:09 UTC) #8
brettw
LGTM http://codereview.chromium.org/174277/diff/1021/51 File chrome/browser/extensions/extension_dom_ui.cc (right): http://codereview.chromium.org/174277/diff/1021/51#newcode40 Line 40: GURL url = controller.pending_entry()->url(); Can you use ...
11 years, 4 months ago (2009-08-25 22:24:11 UTC) #9
Aaron Boodman
I wonder if we should only allow the NTP to be released at first. If ...
11 years, 3 months ago (2009-08-26 19:56:54 UTC) #10
tim (not reviewing)
http://codereview.chromium.org/174277/diff/1021/51 File chrome/browser/extensions/extension_dom_ui.cc (right): http://codereview.chromium.org/174277/diff/1021/51#newcode89 Line 89: return false; I don't know the whole context ...
11 years, 3 months ago (2009-08-26 20:47:24 UTC) #11
Erik does not do reviews
new snapshot uploaded > I wonder if we should only allow the NTP to be ...
11 years, 3 months ago (2009-08-26 21:10:53 UTC) #12
Erik does not do reviews
http://codereview.chromium.org/174277/diff/1021/51 File chrome/browser/extensions/extension_dom_ui.cc (right): http://codereview.chromium.org/174277/diff/1021/51#newcode89 Line 89: return false; On 2009/08/26 20:47:24, timsteele wrote: > ...
11 years, 3 months ago (2009-08-26 21:13:09 UTC) #13
Aaron Boodman
11 years, 3 months ago (2009-08-26 21:22:28 UTC) #14
LGTM

On 2009/08/26 21:10:53, Erik Kay wrote:
> new snapshot uploaded
> 
> > I wonder if we should only allow the NTP to be released 
> > at first. If we did that, we could add extensions to the
> > UI where you select what your homepage would be. 
> 
> I'm fine restricting overrides to newtab with the initial release (since that
> was the initial goal here anyway)

Ok, my vote is to do that then until we get more people wanting to override
other pages.

> but I don't think it helps that much with the
> UI or the fallback logic.  You still need fallback for uninstall, disabling,
> etc.  For the UI, NTP and home page are totally different, so it wouldn't be
an
> extension so much as a new section to the options UI, which would be the same
> for any of the pages we allow to be overridden.

Per offline discussion, you are right. I did not realize that the existing UI
does not affect what happens when you use ctrl+t or press the new tab button.

- a

Powered by Google App Engine
This is Rietveld 408576698