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

Issue 10910304: Cache the object given to the chrome.app.window.create callback (Closed)

Created:
8 years, 3 months ago by tapted
Modified:
8 years, 2 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org, darin-cc_chromium.org
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Cache the object given to the chrome.app.window.create callback and use it for later calls to current() This version also sets the read-only `id` property on the returned appWindow object (accessor for window_key), which can be passed in with the create params. BUG=148814 TEST=./browser_tests --gtest_filter=PlatformAppBrowserTest.WindowsApi Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=158996

Patch Set 1 #

Patch Set 2 : No need to index, since we have a unique chromeHidden context. Worry about developer reloads later #

Patch Set 3 : style #

Patch Set 4 : access to the id property via cache, leave out GetRoutingID for now #

Total comments: 22

Patch Set 5 : first round of comments #

Total comments: 6

Patch Set 6 : comments, still need to get id bootstrapping correct #

Patch Set 7 : Pass the window_key back along with the view_id to the custom callback #

Patch Set 8 : improve cohesion with the prototype / JS context based on verbal feedback #

Total comments: 5

Patch Set 9 : better arg name, less nesting #

Patch Set 10 : rebase to r157512 (conflicts) #

Total comments: 2

Patch Set 11 : reviewer comments: create->initialize, cache->data #

Patch Set 12 : stray/unused return statement #

Patch Set 13 : rebase due to r158473 #

Total comments: 6

Patch Set 14 : nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+74 lines, -16 lines) Patch
M chrome/browser/extensions/api/app_window/app_window_api.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/extensions/shell_window.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/app_window.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/resources/extensions/app_window_custom_bindings.js View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +45 lines, -14 lines 0 comments Download
M chrome/test/data/extensions/platform_apps/windows_api/test.js View 1 2 3 4 1 chunk +26 lines, -2 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
benwells
https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js File chrome/renderer/resources/extensions/app_window_custom_bindings.js (right): https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js#newcode22 chrome/renderer/resources/extensions/app_window_custom_bindings.js:22: // create failed? If given a callback, trigger it ...
8 years, 3 months ago (2012-09-17 08:33:30 UTC) #1
tapted
https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js File chrome/renderer/resources/extensions/app_window_custom_bindings.js (right): https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js#newcode22 chrome/renderer/resources/extensions/app_window_custom_bindings.js:22: // create failed? If given a callback, trigger it ...
8 years, 3 months ago (2012-09-17 09:22:13 UTC) #2
jeremya
https://codereview.chromium.org/10910304/diff/4007/chrome/common/extensions/api/app_window.idl File chrome/common/extensions/api/app_window.idl (right): https://codereview.chromium.org/10910304/diff/4007/chrome/common/extensions/api/app_window.idl#newcode112 chrome/common/extensions/api/app_window.idl:112: [internal, nocompile] static void makeAppWindow(object state); I don't think ...
8 years, 3 months ago (2012-09-17 17:46:58 UTC) #3
benwells
https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js File chrome/renderer/resources/extensions/app_window_custom_bindings.js (right): https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js#newcode34 chrome/renderer/resources/extensions/app_window_custom_bindings.js:34: viewId: viewId, On 2012/09/17 09:22:13, tapted wrote: > On ...
8 years, 3 months ago (2012-09-18 03:47:24 UTC) #4
tapted
https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js File chrome/renderer/resources/extensions/app_window_custom_bindings.js (right): https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js#newcode34 chrome/renderer/resources/extensions/app_window_custom_bindings.js:34: viewId: viewId, On 2012/09/18 03:47:24, benwells wrote: > On ...
8 years, 3 months ago (2012-09-18 04:17:24 UTC) #5
benwells
On 2012/09/18 04:17:24, tapted wrote: > https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js > File chrome/renderer/resources/extensions/app_window_custom_bindings.js (right): > > https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js#newcode34 > ...
8 years, 3 months ago (2012-09-18 04:23:06 UTC) #6
tapted
This version does scoped_ptr<base::DictionaryValue> result(new base::DictionaryValue); result->SetInteger("viewId", view_id); result->SetString("id", shell_window->window_key()); SetResult(result.release()); in app_window_api.cc to "bootstrap" ...
8 years, 3 months ago (2012-09-18 05:07:45 UTC) #7
tapted
https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js File chrome/renderer/resources/extensions/app_window_custom_bindings.js (right): https://codereview.chromium.org/10910304/diff/6001/chrome/renderer/resources/extensions/app_window_custom_bindings.js#newcode57 chrome/renderer/resources/extensions/app_window_custom_bindings.js:57: AppWindow.prototype.dom = window; On 2012/09/17 09:22:13, tapted wrote: > ...
8 years, 3 months ago (2012-09-18 07:47:31 UTC) #8
benwells
lgtm with nit and things to consider please wait for jeremya@'s lgtm before landing https://codereview.chromium.org/10910304/diff/14002/chrome/renderer/resources/extensions/app_window_custom_bindings.js ...
8 years, 3 months ago (2012-09-19 00:09:21 UTC) #9
tapted
@jeremya - how are we lookin'? https://codereview.chromium.org/10910304/diff/14002/chrome/renderer/resources/extensions/app_window_custom_bindings.js File chrome/renderer/resources/extensions/app_window_custom_bindings.js (right): https://codereview.chromium.org/10910304/diff/14002/chrome/renderer/resources/extensions/app_window_custom_bindings.js#newcode16 chrome/renderer/resources/extensions/app_window_custom_bindings.js:16: function(name, request, shellWindow) ...
8 years, 3 months ago (2012-09-19 00:54:02 UTC) #10
jeremya
Something still doesn't sit right with me about the makeAppWindow stuff. Here's some thinking: With ...
8 years, 3 months ago (2012-09-19 16:13:15 UTC) #11
benwells
On 2012/09/19 16:13:15, jeremya wrote: > Something still doesn't sit right with me about the ...
8 years, 3 months ago (2012-09-20 01:35:29 UTC) #12
jeremya
On 2012/09/20 01:35:29, benwells wrote: > On 2012/09/19 16:13:15, jeremya wrote: > > Something still ...
8 years, 3 months ago (2012-09-21 17:57:27 UTC) #13
jeremya
lgtm with makeAppWindow -> initializeAppWindow and appWindowCache -> appWindowData
8 years, 3 months ago (2012-09-24 22:53:33 UTC) #14
jeremya
On 2012/09/24 22:53:33, jeremya wrote: > lgtm with makeAppWindow -> initializeAppWindow and appWindowCache -> > ...
8 years, 3 months ago (2012-09-24 22:53:55 UTC) #15
tapted
Reaching out to Mihai for review/feedback (change in extensions/ui -- accessor for window_key ShellWindow data ...
8 years, 2 months ago (2012-09-25 21:27:22 UTC) #16
Mihai Parparita -not on Chrome
LGTM Given Ben's impending fix for http://crbug.com/150033, the bit in the CL description about reloading ...
8 years, 2 months ago (2012-09-26 22:22:23 UTC) #17
tapted
Fixed the idl and nits. Thanks! https://chromiumcodereview.appspot.com/10910304/diff/29008/chrome/common/extensions/api/app_window.idl File chrome/common/extensions/api/app_window.idl (right): https://chromiumcodereview.appspot.com/10910304/diff/29008/chrome/common/extensions/api/app_window.idl#newcode112 chrome/common/extensions/api/app_window.idl:112: [nocompile] static void ...
8 years, 2 months ago (2012-09-27 01:27:15 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/tapted@chromium.org/10910304/44001
8 years, 2 months ago (2012-09-27 05:37:35 UTC) #19
commit-bot: I haz the power
8 years, 2 months ago (2012-09-27 08:59:06 UTC) #20
Change committed as 158996

Powered by Google App Engine
This is Rietveld 408576698