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

Issue 25305002: Implement initial chrome.browserAction.openPopup API. (Closed)

Created:
7 years, 2 months ago by justinlin
Modified:
7 years, 2 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, tfarina, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 6

Patch Set 2 : all platofrms #

Patch Set 3 : checkpoint #

Patch Set 4 : #

Patch Set 5 : please review #

Total comments: 33

Patch Set 6 : #

Total comments: 42

Patch Set 7 : #

Patch Set 8 : address comments #

Total comments: 16

Patch Set 9 : fixes #

Total comments: 6

Patch Set 10 : comments #

Total comments: 10

Patch Set 11 : mpcomplete@ #

Total comments: 4

Patch Set 12 : Use result from requesting open popup #

Patch Set 13 : sync #

Total comments: 20

Patch Set 14 : finnur@ comments #

Total comments: 15

Patch Set 15 : add comment #

Total comments: 6

Patch Set 16 : fix obj-c #

Total comments: 2

Patch Set 17 : comments #

Patch Set 18 : move to interactive_ui_test #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+555 lines, -47 lines) Patch
M chrome/browser/extensions/active_tab_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/extension_action/browser_action_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +3 lines, -2 lines 0 comments Download
A chrome/browser/extensions/api/extension_action/browser_action_interactive_test.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +188 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/extension_action/extension_action_api.h View 1 2 3 4 5 6 7 2 chunks +26 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/extension_action/extension_action_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 5 chunks +65 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/extensions/error_console/error_console_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_function_histogram_value.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_toolbar_model.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 4 chunks +15 lines, -3 lines 0 comments Download
M chrome/browser/extensions/extension_toolbar_model.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +25 lines, -3 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +27 lines, -5 lines 0 comments Download
M chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 8 chunks +41 lines, -14 lines 0 comments Download
M chrome/browser/ui/views/browser_actions_container.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +8 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/browser_actions_container.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 7 chunks +36 lines, -8 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/_api_features.json View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +20 lines, -0 lines 0 comments Download
M chrome/common/extensions/api/browser_action.json View 1 2 3 4 5 6 7 1 chunk +19 lines, -0 lines 0 comments Download
M chrome/common/extensions/features/complex_feature.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/renderer/resources/extensions/browser_action_custom_bindings.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +14 lines, -0 lines 2 comments Download
A chrome/test/data/extensions/api_test/browser_action/open_popup/manifest.json View 1 2 3 4 5 6 7 8 9 1 chunk +13 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/browser_action/open_popup/open_popup_fails.html View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/browser_action/open_popup/open_popup_fails.js View 1 2 3 4 5 6 7 8 9 1 chunk +16 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/browser_action/open_popup/open_popup_succeeds.html View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/browser_action/open_popup/open_popup_succeeds.js View 1 2 3 4 5 6 7 1 chunk +16 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/browser_action/open_popup/popup.html View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
mark a. foltz
A couple of comments https://codereview.chromium.org/25305002/diff/1/chrome/browser/chrome_notification_types.h File chrome/browser/chrome_notification_types.h (right): https://codereview.chromium.org/25305002/diff/1/chrome/browser/chrome_notification_types.h#newcode553 chrome/browser/chrome_notification_types.h:553: NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_SHOW, What are the source ...
7 years, 2 months ago (2013-10-07 22:08:14 UTC) #1
justinlin
There's implementations for all platforms now, but still some bugs to iron out, namely none ...
7 years, 2 months ago (2013-10-09 18:19:32 UTC) #2
justinlin
hi matt, mark, ptal @ patch set #5 for a first review. there's a few ...
7 years, 2 months ago (2013-10-11 17:39:54 UTC) #3
mark a. foltz
On 2013/10/11 17:39:54, justinlin wrote: > hi matt, mark, ptal @ patch set #5 for ...
7 years, 2 months ago (2013-10-11 20:25:20 UTC) #4
mark a. foltz
https://codereview.chromium.org/25305002/diff/30001/chrome/browser/extensions/api/extension_action/extension_action_api.cc File chrome/browser/extensions/api/extension_action/extension_action_api.cc (right): https://codereview.chromium.org/25305002/diff/30001/chrome/browser/extensions/api/extension_action/extension_action_api.cc#newcode7 chrome/browser/extensions/api/extension_action/extension_action_api.cc:7: #include <set> Did you mean to remove #include <string>? ...
7 years, 2 months ago (2013-10-11 20:25:30 UTC) #5
Matt Perry
Adding finnur to check the implementation. It's more complex than I thought. I would've expected ...
7 years, 2 months ago (2013-10-11 22:22:52 UTC) #6
Finnur
This refers to patch set 6. I forgot to send this out yesterday (sorry) -- ...
7 years, 2 months ago (2013-10-15 10:44:21 UTC) #7
Matt Perry
https://codereview.chromium.org/25305002/diff/44001/chrome/common/extensions/api/browser_action.json File chrome/common/extensions/api/browser_action.json (right): https://codereview.chromium.org/25305002/diff/44001/chrome/common/extensions/api/browser_action.json#newcode329 chrome/common/extensions/api/browser_action.json:329: ] On 2013/10/15 10:44:21, Finnur wrote: > Is it ...
7 years, 2 months ago (2013-10-15 21:29:41 UTC) #8
justinlin
Thanks for the comments! Addressed them and fixed TODO's. Will add last few missing browser ...
7 years, 2 months ago (2013-10-16 07:06:48 UTC) #9
justinlin
Adding ui/* owners. erg: ptal gtk sky: ptal views asvitkine: ptal cocoa This mostly adds ...
7 years, 2 months ago (2013-10-16 07:11:52 UTC) #10
sky
https://codereview.chromium.org/25305002/diff/73001/chrome/browser/ui/views/browser_actions_container.cc File chrome/browser/ui/views/browser_actions_container.cc (right): https://codereview.chromium.org/25305002/diff/73001/chrome/browser/ui/views/browser_actions_container.cc#newcode694 chrome/browser/ui/views/browser_actions_container.cc:694: BrowserList::GetInstance(chrome::GetActiveDesktop())->GetLastActive() != browser_->window()->IsActive()? https://codereview.chromium.org/25305002/diff/73001/chrome/browser/ui/views/browser_actions_container.cc#newcode703 chrome/browser/ui/views/browser_actions_container.cc:703: button = (*it)->button(); How ...
7 years, 2 months ago (2013-10-16 14:19:25 UTC) #11
Finnur
https://codereview.chromium.org/25305002/diff/44001/chrome/common/extensions/api/_api_features.json File chrome/common/extensions/api/_api_features.json (right): https://codereview.chromium.org/25305002/diff/44001/chrome/common/extensions/api/_api_features.json#newcode105 chrome/common/extensions/api/_api_features.json:105: "contexts": ["blessed_extension", "unblessed_extension"] Um... can you remove it then? ...
7 years, 2 months ago (2013-10-16 15:01:26 UTC) #12
Elliot Glaysher
gtk lgtm
7 years, 2 months ago (2013-10-16 17:21:14 UTC) #13
mark a. foltz
lgtm https://codereview.chromium.org/25305002/diff/95001/chrome/browser/extensions/api/extension_action/extension_action_api.cc File chrome/browser/extensions/api/extension_action/extension_action_api.cc (right): https://codereview.chromium.org/25305002/diff/95001/chrome/browser/extensions/api/extension_action/extension_action_api.cc#newcode856 chrome/browser/extensions/api/extension_action/extension_action_api.cc:856: SendResponse(new base::ListValue()); Is this what you intended? The ...
7 years, 2 months ago (2013-10-16 19:00:52 UTC) #14
justinlin
thanks! ptal. finner@: We can discuss offline if we want to enable for dev or ...
7 years, 2 months ago (2013-10-16 19:31:28 UTC) #15
justinlin
finnur*, sorry
7 years, 2 months ago (2013-10-16 20:23:03 UTC) #16
Matt Perry
Almost there. https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc File chrome/browser/extensions/api/extension_action/extension_action_api.cc (right): https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc#newcode830 chrome/browser/extensions/api/extension_action/extension_action_api.cc:830: base::TimeDelta::FromSeconds(1)); Why add a timeout? The popup ...
7 years, 2 months ago (2013-10-16 20:34:35 UTC) #17
justinlin
https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc File chrome/browser/extensions/api/extension_action/extension_action_api.cc (right): https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc#newcode830 chrome/browser/extensions/api/extension_action/extension_action_api.cc:830: base::TimeDelta::FromSeconds(1)); On 2013/10/16 20:34:35, Matt Perry wrote: > Why ...
7 years, 2 months ago (2013-10-16 21:16:22 UTC) #18
Matt Perry
https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc File chrome/browser/extensions/api/extension_action/extension_action_api.cc (right): https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc#newcode830 chrome/browser/extensions/api/extension_action/extension_action_api.cc:830: base::TimeDelta::FromSeconds(1)); On 2013/10/16 21:16:23, justinlin wrote: > On 2013/10/16 ...
7 years, 2 months ago (2013-10-16 21:32:49 UTC) #19
justinlin
https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc File chrome/browser/extensions/api/extension_action/extension_action_api.cc (right): https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc#newcode830 chrome/browser/extensions/api/extension_action/extension_action_api.cc:830: base::TimeDelta::FromSeconds(1)); On 2013/10/16 21:32:50, Matt Perry wrote: > On ...
7 years, 2 months ago (2013-10-16 21:42:01 UTC) #20
Matt Perry
https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc File chrome/browser/extensions/api/extension_action/extension_action_api.cc (right): https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc#newcode830 chrome/browser/extensions/api/extension_action/extension_action_api.cc:830: base::TimeDelta::FromSeconds(1)); On 2013/10/16 21:42:01, justinlin wrote: > On 2013/10/16 ...
7 years, 2 months ago (2013-10-16 21:45:21 UTC) #21
sky
https://codereview.chromium.org/25305002/diff/109001/chrome/browser/ui/views/browser_actions_container.cc File chrome/browser/ui/views/browser_actions_container.cc (right): https://codereview.chromium.org/25305002/diff/109001/chrome/browser/ui/views/browser_actions_container.cc#newcode695 chrome/browser/ui/views/browser_actions_container.cc:695: BrowserActionButton* button = NULL; Did you try this? I ...
7 years, 2 months ago (2013-10-16 22:26:06 UTC) #22
justinlin
thanks! ptal https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc File chrome/browser/extensions/api/extension_action/extension_action_api.cc (right): https://codereview.chromium.org/25305002/diff/100001/chrome/browser/extensions/api/extension_action/extension_action_api.cc#newcode830 chrome/browser/extensions/api/extension_action/extension_action_api.cc:830: base::TimeDelta::FromSeconds(1)); Yea, I considered it, but it ...
7 years, 2 months ago (2013-10-17 04:14:51 UTC) #23
Finnur
https://codereview.chromium.org/25305002/diff/73001/chrome/browser/extensions/extension_toolbar_model.h File chrome/browser/extensions/extension_toolbar_model.h (right): https://codereview.chromium.org/25305002/diff/73001/chrome/browser/extensions/extension_toolbar_model.h#newcode76 chrome/browser/extensions/extension_toolbar_model.h:76: bool should_grant); The public style guide seems to be ...
7 years, 2 months ago (2013-10-17 14:58:33 UTC) #24
justinlin
thanks! ptal https://codereview.chromium.org/25305002/diff/73001/chrome/browser/extensions/extension_toolbar_model.h File chrome/browser/extensions/extension_toolbar_model.h (right): https://codereview.chromium.org/25305002/diff/73001/chrome/browser/extensions/extension_toolbar_model.h#newcode76 chrome/browser/extensions/extension_toolbar_model.h:76: bool should_grant); On 2013/10/17 14:58:34, Finnur wrote: ...
7 years, 2 months ago (2013-10-17 18:32:52 UTC) #25
Alexei Svitkine (slow)
https://codereview.chromium.org/25305002/diff/145001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm File chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm (right): https://codereview.chromium.org/25305002/diff/145001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm#newcode142 chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm:142: - (bool)browserActionClicked:(BrowserActionButton*)button Can you add a comment here and ...
7 years, 2 months ago (2013-10-17 20:39:55 UTC) #26
justinlin
https://codereview.chromium.org/25305002/diff/145001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm File chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm (right): https://codereview.chromium.org/25305002/diff/145001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm#newcode142 chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm:142: - (bool)browserActionClicked:(BrowserActionButton*)button On 2013/10/17 20:39:55, Alexei Svitkine wrote: > ...
7 years, 2 months ago (2013-10-17 20:49:46 UTC) #27
Alexei Svitkine (slow)
Cocoa LGTM with nits. https://codereview.chromium.org/25305002/diff/155001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm File chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm (right): https://codereview.chromium.org/25305002/diff/155001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm#newcode141 chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm:141: // it should grant tab ...
7 years, 2 months ago (2013-10-17 20:56:39 UTC) #28
justinlin
thanks mpcomplete, finner@: ptal for extension stuff sky@: ptal for views/ https://codereview.chromium.org/25305002/diff/155001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm File chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm (right): ...
7 years, 2 months ago (2013-10-17 21:33:58 UTC) #29
Matt Perry
lgtm
7 years, 2 months ago (2013-10-17 21:49:56 UTC) #30
sky
LGTM
7 years, 2 months ago (2013-10-18 00:41:20 UTC) #31
Finnur
Your new tests are failing on some of the bots. See for example: http://build.chromium.org/p/tryserver.chromium/builders/linux_aura/builds/87913 https://codereview.chromium.org/25305002/diff/132001/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc ...
7 years, 2 months ago (2013-10-18 10:31:00 UTC) #32
justinlin
thanks, I think a few of those were already addressed in the latest patch. fixing ...
7 years, 2 months ago (2013-10-19 06:01:48 UTC) #33
justinlin
OK, ptal. Moved the tests to interactive_ui_tests. Now they should all pass. They needed to ...
7 years, 2 months ago (2013-10-21 06:57:10 UTC) #34
Finnur
LGTM https://codereview.chromium.org/25305002/diff/145001/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc File chrome/browser/extensions/api/extension_action/browser_action_apitest.cc (right): https://codereview.chromium.org/25305002/diff/145001/chrome/browser/extensions/api/extension_action/browser_action_apitest.cc#newcode825 chrome/browser/extensions/api/extension_action/browser_action_apitest.cc:825: const Extension* extension = GetSingleLoadedExtension(); If it fails, ...
7 years, 2 months ago (2013-10-21 08:12:11 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/justinlin@chromium.org/25305002/382001
7 years, 2 months ago (2013-10-21 08:31:40 UTC) #36
commit-bot: I haz the power
Change committed as 229777
7 years, 2 months ago (2013-10-21 11:24:58 UTC) #37
not at google - send to devlin
https://codereview.chromium.org/25305002/diff/382001/chrome/renderer/resources/extensions/browser_action_custom_bindings.js File chrome/renderer/resources/extensions/browser_action_custom_bindings.js (right): https://codereview.chromium.org/25305002/diff/382001/chrome/renderer/resources/extensions/browser_action_custom_bindings.js#newcode23 chrome/renderer/resources/extensions/browser_action_custom_bindings.js:23: throw new Error(chrome.runtime.lastError.message); don't throw an error here. chrome.runtime.lastError ...
7 years, 2 months ago (2013-10-23 23:18:40 UTC) #38
justinlin
7 years, 2 months ago (2013-10-24 00:01:37 UTC) #39
Message was sent while issue was closed.
https://codereview.chromium.org/25305002/diff/382001/chrome/renderer/resource...
File chrome/renderer/resources/extensions/browser_action_custom_bindings.js
(right):

https://codereview.chromium.org/25305002/diff/382001/chrome/renderer/resource...
chrome/renderer/resources/extensions/browser_action_custom_bindings.js:23: throw
new Error(chrome.runtime.lastError.message);
Ah thanks. https://codereview.chromium.org/32283005/. I thought API's can throw
an exception as well on error, but I think that's only for before the call when
things like input parameters are the wrong type.

Powered by Google App Engine
This is Rietveld 408576698