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

Issue 62178: Flesh out more extensions tab api (added removeTab, updateTab) (Closed)

Created:
11 years, 8 months ago by rafaelw
Modified:
9 years, 7 months ago
Reviewers:
Aaron Boodman, brettw
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Flesh out more extensions tab api (added getTab, removeTab, updateTab) Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=13497

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 3

Patch Set 4 : '' #

Total comments: 23

Patch Set 5 : '' #

Total comments: 1

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1449 lines, -8 lines) Patch
M chrome/browser/extensions/extension_function_dispatcher.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_module.h View 1 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_module.cc View 1 2 3 4 5 6 7 4 chunks +156 lines, -6 lines 0 comments Download
M chrome/renderer/resources/extension_process_bindings.js View 1 2 chunks +21 lines, -2 lines 0 comments Download
A chrome/test/data/extensions/test/TabsAPI/1/jstemplate_compiled.js View 1 chunk +1182 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/test/TabsAPI/1/manifest.json View 1 chunk +8 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/test/TabsAPI/1/tabs_api.html View 1 chunk +69 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/test/TabsAPI/Current Version View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
rafaelw
11 years, 8 months ago (2009-04-09 23:07:14 UTC) #1
rafaelw
11 years, 8 months ago (2009-04-09 23:24:19 UTC) #2
brettw
drive by http://codereview.chromium.org/62178/diff/2004/3013 File chrome/browser/extensions/extension_tabs_module.cc (right): http://codereview.chromium.org/62178/diff/2004/3013#newcode17 Line 17: static bool GetIndexOfTabId(const TabStripModel* tab_strip, const ...
11 years, 8 months ago (2009-04-10 00:00:25 UTC) #3
Aaron Boodman
http://codereview.chromium.org/62178/diff/2002/3009 File chrome/browser/extensions/extension_tabs_module.cc (right): http://codereview.chromium.org/62178/diff/2002/3009#newcode83 Line 83: return true; Observation: CreateTab() seems to work pretty ...
11 years, 8 months ago (2009-04-10 01:37:24 UTC) #4
Aaron Boodman
lgtm http://codereview.chromium.org/62178/diff/4001/4004 File chrome/browser/extensions/extension_tabs_module.cc (right): http://codereview.chromium.org/62178/diff/4001/4004#newcode173 Line 173: // TODO(rafaelw): Do something reasonable if an ...
11 years, 8 months ago (2009-04-10 02:40:48 UTC) #5
rafaelw
11 years, 8 months ago (2009-04-10 04:25:36 UTC) #6
http://codereview.chromium.org/62178/diff/2004/3013
File chrome/browser/extensions/extension_tabs_module.cc (right):

http://codereview.chromium.org/62178/diff/2004/3013#newcode17
Line 17: static bool GetIndexOfTabId(const TabStripModel* tab_strip, const int
tab_id,
On 2009/04/10 00:00:25, brettw wrote:
> We don't usually say "const" for things passed by value.

Done.

http://codereview.chromium.org/62178/diff/2004/3013#newcode18
Line 18: int& tab_index);
On 2009/04/10 00:00:25, brettw wrote:
> Don't use references for out values. We use pointers instead.

Done.

http://codereview.chromium.org/62178/diff/2004/3013#newcode95
Line 95: if (!args_->GetAsInteger(&tab_id)) {
On 2009/04/10 01:37:25, Aaron Boodman wrote:
> You don't really need to re-check this as you just tested it above. Also,
braces
> aren't necessary for one-liners like this.

Done.

http://codereview.chromium.org/62178/diff/2004/3013#newcode101
Line 101: if (GetIndexOfTabId(tab_strip, tab_id, tab_index)) {
On 2009/04/10 01:37:25, Aaron Boodman wrote:
> Prefer to do the opposite check and return early in cases, like this, to
reduce
> indentation.

Done.

http://codereview.chromium.org/62178/diff/2004/3013#newcode101
Line 101: if (GetIndexOfTabId(tab_strip, tab_id, tab_index)) {
On 2009/04/10 01:37:25, Aaron Boodman wrote:
> Add a TODO to return an error here?

Done.

http://codereview.chromium.org/62178/diff/2004/3013#newcode123
Line 123: if (!(args_hash->GetInteger(L"id", &tab_id))) {
On 2009/04/10 01:37:25, Aaron Boodman wrote:
> Style nit: our code usually doesn't use braces for one-liners.

Done.

http://codereview.chromium.org/62178/diff/2004/3013#newcode129
Line 129: if (GetIndexOfTabId(tab_strip, tab_id, tab_index)) {
On 2009/04/10 01:37:25, Aaron Boodman wrote:
> Again, would be nicer to reverse this and return early and add a TODO to
return
> an error.

Done.

http://codereview.chromium.org/62178/diff/2004/3013#newcode142
Line 142: if ((args_hash->GetString(L"url", &url)) &&
On 2009/04/10 01:37:25, Aaron Boodman wrote:
> Don't think we need to compare the URLs. Just re-navigate it if it was
> specified, even if it was the same.

Done.

http://codereview.chromium.org/62178/diff/2004/3013#newcode155
Line 155: if ((args_hash->GetBoolean(L"selected", &selected)) &&
On 2009/04/10 01:37:25, Aaron Boodman wrote:
> style nit: lose the extra parens around each expression in the condition.

Done.

http://codereview.chromium.org/62178/diff/2004/3013#newcode167
Line 167: tab_index = new_index;
On 2009/04/10 01:37:25, Aaron Boodman wrote:
> Setting this here doesn't seem to have any affect.

It did when I was returning the tab object in the callback. =-). Done.

http://codereview.chromium.org/62178/diff/2004/3013#newcode178
Line 178: // This call could remove the tab that it originated from (in the case
of
On 2009/04/10 01:37:25, Aaron Boodman wrote:
> Per our discussion today, I think there should still be a success (and
failure,
> in the future) handler. This just means that we need to solve the case where
the
> window goes away while an API is running. Matt had some ideas on how to do
this,
> but for now can you change this to a TODO?

Done.

Powered by Google App Engine
This is Rietveld 408576698