Descriptionalternate 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 #Messages
Total messages: 41 (2 generated)
|