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

Issue 11413018: alternate ntp: implement searchbox api for instant overlay to adopt themes (Closed)

Created:
8 years, 1 month ago by kuan
Modified:
4 years, 1 month ago
CC:
Aaron Boodman, chromium-apps-reviews_chromium.org, chromium-reviews, darin-cc_chromium.org, David Black, dhollowa, dominich, gideonwald, Jered, melevin, samarth, sreeram, tfarina
Visibility:
Public.

Description

alternate ntp: implement searchbox api for instant overlay to adopt themes - add SearchBoxExtensionWrapper::GetThemeBackgroundInfo * returns theme background info: color, image url, image horizontal alignment, image vertical alignment, image tiling and image height * color is always filled, the rest are only filled if the theme has a custom background image that overlay needs to draw * should only be called when overlay is in ntp mode * when theme changes in ntp mode, BrowserInstantController caches the theme info; if mode is ntp, event is dispatched to onthemechanged callback, which should call GetThemeBackgroundInfo - add SearchBoxExtensionWrapper::GetThemeAreaHeight * returns the height of the area that the entire theme background image should fill up * should only be called when overlay is in ntp mode and theme background image is not top-aligned; top-aligned images are always painted from overlay's top-left corner, so this value is irrelevant and will be invalid * change of this height is monitored when BrowserView lays out its children, then updated and cached in BrowserInstantController; if above conditions are met, event is dispatched to onthemeareaheightchanged callback, which should call GetThemeAreaHeight - theme area height is also sent to preview when theme changes, 'cos the height may have changed with the previous theme but wasn't updated to preview - theme info and area height are also sent to preview when search mode changes to ntp, 'cos they may have changed during the previous mode but not updated to preview BUG=160957 TEST=the web page needs to be implemented before this can be manually tested Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=168908

Patch Set 1 #

Patch Set 2 : fixed to only send ht change when there's theme image #

Total comments: 11

Patch Set 3 : add comments for when to call api #

Patch Set 4 : addressed dhollowa@'s comments #

Patch Set 5 : fixed typo #

Patch Set 6 : rebased to resolve conflicts #

Total comments: 4

Patch Set 7 : addressed dcblack's comments #

Patch Set 8 : fixed clang build errors #

Patch Set 9 : addressed jeremy's comments #

Patch Set 10 : removed extra dispatch of theme area height on init #

Total comments: 4

Patch Set 11 : addressed scott's comments #

Total comments: 32

Patch Set 12 : addressed sreeram's and chri's comments #

Patch Set 13 : addressed sreeram's and chris's comments #

Total comments: 8

Patch Set 14 : addressed chris's and sreeram's comments #

Patch Set 15 : rebased to resolve conflicts #

Total comments: 8

Patch Set 16 : addressed sreeram's comments #

Total comments: 2

Patch Set 17 : addressed sreeram's comments, fixed to not set theme fields if no theme #

Unified diffs Side-by-side diffs Delta from patch set Stats (+527 lines, -11 lines) Patch
chrome/browser/instant/instant_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +9 lines, -0 lines 0 comments Download
chrome/browser/instant/instant_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +12 lines, -1 line 0 comments Download
chrome/browser/instant/instant_loader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/instant/instant_loader.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +15 lines, -0 lines 0 comments Download
chrome/browser/ui/browser_instant_controller.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +30 lines, -0 lines 0 comments Download
chrome/browser/ui/browser_instant_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +141 lines, -1 line 0 comments Download
M chrome/browser/ui/views/frame/browser_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +9 lines, -0 lines 0 comments Download
chrome/common/chrome_notification_types.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/common/instant_types.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +50 lines, -0 lines 0 comments Download
chrome/common/instant_types.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +14 lines, -0 lines 0 comments Download
chrome/common/render_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +20 lines, -0 lines 0 comments Download
chrome/renderer/resources/extensions/searchbox_api.js View 1 2 3 4 5 6 7 8 9 10 4 chunks +6 lines, -2 lines 0 comments Download
chrome/renderer/searchbox/searchbox.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +6 lines, -0 lines 0 comments Download
chrome/renderer/searchbox/searchbox.cc View 1 2 3 4 5 6 7 8 9 10 11 5 chunks +32 lines, -1 line 0 comments Download
M chrome/renderer/searchbox/searchbox_extension.h View 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/renderer/searchbox/searchbox_extension.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8 chunks +174 lines, -0 lines 0 comments Download

Messages

Total messages: 41 (2 generated)
kuan
this is a first-draft implementation of providing theme info to searchbox api. the impl is ...
8 years, 1 month ago (2012-11-15 20:56:20 UTC) #1
kuan
because resizing of browser window is platform-dependent, this impl is only for cros/win only.
8 years, 1 month ago (2012-11-15 20:59:21 UTC) #2
jeremycho
On 2012/11/15 20:59:21, kuan wrote: > because resizing of browser window is platform-dependent, this impl ...
8 years, 1 month ago (2012-11-15 21:26:23 UTC) #3
kuan
On 2012/11/15 21:26:23, jeremycho wrote: > On 2012/11/15 20:59:21, kuan wrote: > > because resizing ...
8 years, 1 month ago (2012-11-15 21:35:30 UTC) #4
dhollowa
Redacting myself... others will have this covered better. https://codereview.chromium.org/11413018/diff/4001/chrome/common/instant_types.h File chrome/common/instant_types.h (right): https://codereview.chromium.org/11413018/diff/4001/chrome/common/instant_types.h#newcode99 chrome/common/instant_types.h:99: ThemeBackgroundInfo(); ...
8 years, 1 month ago (2012-11-15 22:00:33 UTC) #5
kuan
i've addressed dhollowa@'s comments in patch set 4; #5 is a typo fix. ptal. thx. ...
8 years, 1 month ago (2012-11-15 22:19:15 UTC) #6
kuan
fyi, patch set #6 is rebased to resolve conflicts that jeremy encountered when patching the ...
8 years, 1 month ago (2012-11-15 22:55:17 UTC) #7
jeremycho
On 2012/11/15 22:55:17, kuan wrote: > fyi, patch set #6 is rebased to resolve conflicts ...
8 years, 1 month ago (2012-11-16 00:08:41 UTC) #8
David Black
https://codereview.chromium.org/11413018/diff/5018/chrome/renderer/resources/extensions/searchbox/searchbox_api.js File chrome/renderer/resources/extensions/searchbox/searchbox_api.js (right): https://codereview.chromium.org/11413018/diff/5018/chrome/renderer/resources/extensions/searchbox/searchbox_api.js#newcode183 chrome/renderer/resources/extensions/searchbox/searchbox_api.js:183: this.__defineGetter__('themeAreaHeight', GetThemeAreaHeight); Why isn't the theme area height part ...
8 years, 1 month ago (2012-11-16 00:57:17 UTC) #9
kuan
i've addressed dcblack's comments in patch set 7. ptal. thx. https://codereview.chromium.org/11413018/diff/5018/chrome/renderer/resources/extensions/searchbox/searchbox_api.js File chrome/renderer/resources/extensions/searchbox/searchbox_api.js (right): https://codereview.chromium.org/11413018/diff/5018/chrome/renderer/resources/extensions/searchbox/searchbox_api.js#newcode183 ...
8 years, 1 month ago (2012-11-16 01:10:03 UTC) #10
kuan
fyi, i've reinstated the ctor/dtor for ThemeBackgroundInfo in patch set 8, 'cos clang doesn't build ...
8 years, 1 month ago (2012-11-16 01:59:51 UTC) #11
jeremycho
From our offline discussion - the way I'm calculating the theme height is a little ...
8 years, 1 month ago (2012-11-16 04:06:16 UTC) #12
kuan
i've addressed jeremy's comments in patch set 9 - add image height to ThemeBackgroundInfo. jeremy, ...
8 years, 1 month ago (2012-11-16 04:28:39 UTC) #13
jeremycho
Thanks kuan. I've got a demo that you can test using --instant-url=http://murakami.mtv.corp.google.com:9111/webhp?espv=1 Because GWS can't ...
8 years, 1 month ago (2012-11-16 06:07:37 UTC) #14
sky
https://codereview.chromium.org/11413018/diff/4008/chrome/browser/ui/browser_instant_controller.cc File chrome/browser/ui/browser_instant_controller.cc (right): https://codereview.chromium.org/11413018/diff/4008/chrome/browser/ui/browser_instant_controller.cc#newcode39 chrome/browser/ui/browser_instant_controller.cc:39: "-webkit-image-set(url(chrome://theme/IDR_THEME_BACKGROUND?%s) 1x)"; nit: indent 2 more. https://codereview.chromium.org/11413018/diff/4008/chrome/browser/ui/views/frame/browser_view.cc File chrome/browser/ui/views/frame/browser_view.cc ...
8 years, 1 month ago (2012-11-19 15:07:31 UTC) #15
kuan
i've addressed all comments in patch set 11, which unfortunately also includes rebasing. ptal. thx. ...
8 years, 1 month ago (2012-11-19 16:59:41 UTC) #16
kuan
hi chris, cld u provide owner's approval for render_messages.h? thx!
8 years, 1 month ago (2012-11-19 17:03:12 UTC) #17
sky
Makes sense, LGTM
8 years, 1 month ago (2012-11-19 17:26:02 UTC) #18
sreeram
LGTM with nits https://codereview.chromium.org/11413018/diff/8041/chrome/browser/instant/instant_controller.cc File chrome/browser/instant/instant_controller.cc (right): https://codereview.chromium.org/11413018/diff/8041/chrome/browser/instant/instant_controller.cc#newcode565 chrome/browser/instant/instant_controller.cc:565: if (loader_.get()) Use "if (GetPreviewContents())" instead ...
8 years, 1 month ago (2012-11-19 18:12:01 UTC) #19
palmer
The basic idea makes sense, but the string-based implementation concerns me from a security perspective ...
8 years, 1 month ago (2012-11-19 18:26:51 UTC) #20
kuan
i've addressed sreeram's and chris's commens in patch set 12. ptal. thx. chris, i did ...
8 years, 1 month ago (2012-11-19 22:06:07 UTC) #21
palmer
Looks pretty good, thank you! One last format string issue, and you need a validator ...
8 years, 1 month ago (2012-11-19 22:23:19 UTC) #22
sreeram
On Mon, Nov 19, 2012 at 2:23 PM, <palmer@chromium.org> wrote: > You may have to ...
8 years, 1 month ago (2012-11-19 22:41:33 UTC) #23
kuan
i've addressed all comments in patch set 14 (using sreeram's advice for the constants). ptal. ...
8 years, 1 month ago (2012-11-20 00:12:44 UTC) #24
kuan
fyi, patch set 15 is rebased to resolve conflicts for instant files.
8 years, 1 month ago (2012-11-20 15:54:32 UTC) #25
sreeram
https://codereview.chromium.org/11413018/diff/1030/chrome/browser/ui/browser_instant_controller.cc File chrome/browser/ui/browser_instant_controller.cc (right): https://codereview.chromium.org/11413018/diff/1030/chrome/browser/ui/browser_instant_controller.cc#newcode169 chrome/browser/ui/browser_instant_controller.cc:169: UpdateThemeInfoForPreview(); Wait, why do we need to send the ...
8 years, 1 month ago (2012-11-20 17:37:58 UTC) #26
kuan
i've addressed sreeram's comments in patch set 16. https://codereview.chromium.org/11413018/diff/1030/chrome/browser/ui/browser_instant_controller.cc File chrome/browser/ui/browser_instant_controller.cc (right): https://codereview.chromium.org/11413018/diff/1030/chrome/browser/ui/browser_instant_controller.cc#newcode169 chrome/browser/ui/browser_instant_controller.cc:169: UpdateThemeInfoForPreview(); ...
8 years, 1 month ago (2012-11-20 17:52:24 UTC) #27
sreeram
https://codereview.chromium.org/11413018/diff/1030/chrome/browser/ui/browser_instant_controller.cc File chrome/browser/ui/browser_instant_controller.cc (right): https://codereview.chromium.org/11413018/diff/1030/chrome/browser/ui/browser_instant_controller.cc#newcode169 chrome/browser/ui/browser_instant_controller.cc:169: UpdateThemeInfoForPreview(); On 2012/11/20 17:52:24, kuan wrote: > i don't ...
8 years, 1 month ago (2012-11-20 17:55:10 UTC) #28
kuan
https://codereview.chromium.org/11413018/diff/1030/chrome/browser/ui/browser_instant_controller.cc File chrome/browser/ui/browser_instant_controller.cc (right): https://codereview.chromium.org/11413018/diff/1030/chrome/browser/ui/browser_instant_controller.cc#newcode169 chrome/browser/ui/browser_instant_controller.cc:169: UpdateThemeInfoForPreview(); On 2012/11/20 17:55:11, sreeram wrote: > On 2012/11/20 ...
8 years, 1 month ago (2012-11-20 18:07:35 UTC) #29
sreeram
https://codereview.chromium.org/11413018/diff/1030/chrome/browser/ui/browser_instant_controller.cc File chrome/browser/ui/browser_instant_controller.cc (right): https://codereview.chromium.org/11413018/diff/1030/chrome/browser/ui/browser_instant_controller.cc#newcode169 chrome/browser/ui/browser_instant_controller.cc:169: UpdateThemeInfoForPreview(); On 2012/11/20 18:07:36, kuan wrote: > the structure ...
8 years, 1 month ago (2012-11-20 18:16:28 UTC) #30
sreeram
LGTM https://codereview.chromium.org/11413018/diff/4023/chrome/browser/instant/instant_controller.cc File chrome/browser/instant/instant_controller.cc (right): https://codereview.chromium.org/11413018/diff/4023/chrome/browser/instant/instant_controller.cc#newcode661 chrome/browser/instant/instant_controller.cc:661: browser_->UpdateThemeInfoForPreview(); Likewise, swap these two lines as well.
8 years, 1 month ago (2012-11-20 18:39:00 UTC) #31
kuan
i've addressed sreeram's comments in patch set 17. i've also fixed to not set theme ...
8 years, 1 month ago (2012-11-20 18:50:47 UTC) #32
palmer
Thanks! LGTM. https://codereview.chromium.org/11413018/diff/55/chrome/renderer/searchbox/searchbox_extension.cc File chrome/renderer/searchbox/searchbox_extension.cc (right): https://codereview.chromium.org/11413018/diff/55/chrome/renderer/searchbox/searchbox_extension.cc#newcode440 chrome/renderer/searchbox/searchbox_extension.cc:440: base::DoubleToString(theme_info.color_a / 255.0).c_str()))); > > theme_info.color_a / ...
8 years, 1 month ago (2012-11-20 19:55:30 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kuan@chromium.org/11413018/4025
8 years, 1 month ago (2012-11-20 19:58:58 UTC) #34
commit-bot: I haz the power
Retried try job too often for step(s) content_browsertests
8 years, 1 month ago (2012-11-20 21:16:26 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/kuan@chromium.org/11413018/4025
8 years, 1 month ago (2012-11-20 21:19:03 UTC) #36
commit-bot: I haz the power
Change committed as 168908
8 years, 1 month ago (2012-11-20 23:41:10 UTC) #37
katsmeowka.kw48
5 years, 2 months ago (2015-10-15 12:03:06 UTC) #39
brmeyerswork
4 years, 1 month ago (2016-11-15 08:23:50 UTC) #41
Message was sent while issue was closed.
lgtm

Powered by Google App Engine
This is Rietveld 408576698