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

Issue 1385663002: [Contextual Search] Add Mojo-enabled API component. (Closed)

Created:
5 years, 2 months ago by Donn Denman
Modified:
5 years ago
CC:
chromium-apps-reviews_chromium.org, chromium-reviews, David Black, dhollowa+watch_chromium.org, donnd+watch_chromium.org, dougw+watch_chromium.org, extensions-reviews_chromium.org, Jered, jfweitz+watch_chromium.org, kmadhusu+watch_chromium.org, melevin+watch_chromium.org, pedro (no code reviews), samarth+watch_chromium.org, skanuj+watch_chromium.org, Theresa
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Contextual Search] Add mojo-enabled API component. Add a simple JavaScript v8 wrapper for Contextual Search, that just defines chrome.contextualSearch.setCaption(String, Boolean); Adds a simple Contextual Search component with mojo communication to handle enabling of the v8 wrapper only on a renderer which is presented in the Contextual Search Overlay view. BUG=523554 Committed: https://crrev.com/bda9b6f432fb237029ed6f4fac16bbe30da0cde4 Cr-Commit-Position: refs/heads/master@{#364460}

Patch Set 1 #

Patch Set 2 : Clean up OWNERS changes. #

Patch Set 3 : Simplify to only track one Renderer process ID. Rebase. #

Total comments: 2

Patch Set 4 : Added a Finch flag required to enable this feature. #

Total comments: 8

Patch Set 5 : Addressed Kausalya's comments, added TODO and bug reference for transition from JS to a better way. #

Total comments: 10

Patch Set 6 : Renamed ContextualSearchService to ContextualSearchApiController. #

Patch Set 7 : Switched back to using a list of process IDs (to support multi-window environments). #

Patch Set 8 : Changed the CS API controller to not be a notification observer. #

Total comments: 4

Patch Set 9 : Addressed Pedro's comments on naming methods in ContextualSearchApiController. #

Total comments: 5

Patch Set 10 : Reworked to use a new Contextual Search component and Mojo communication, removed CS Manager stuff. #

Total comments: 19

Patch Set 11 : Separate component code into browser/common/renderer, and address Jochen's comments. #

Total comments: 8

Patch Set 12 : Using newly exported GetOrCreateChromeObject, renamed ContextualSearchApiService ContextualSearchJs… #

Patch Set 13 : Added a second parameter to the setCaption API call. #

Total comments: 9

Patch Set 14 : Reset the Wrapper when the Frame goes away. #

Total comments: 12

Patch Set 15 : Add a RenderFrameObserver to the Wrapper and clear the gin Handle OnDestruct of the render frame. #

Total comments: 12

Patch Set 16 : Check that render_frame() is not null, and cleaup OnDestruct code. #

Patch Set 17 : Added a couple of missing dependencies to the new component's BUILD.gn rules for our renderer secti… #

Patch Set 18 : Added a few more missing dependencies to the new component's BUILD.gn rules for our renderer sectio… #

Unified diffs Side-by-side diffs Delta from patch set Stats (+593 lines, -2 lines) Patch
M chrome/browser/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/DEPS 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/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_renderer.gypi 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/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/renderer/DEPS 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/chrome_content_renderer_client.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +4 lines, -0 lines 0 comments Download
M components/components.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
A components/contextual_search.gypi View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +57 lines, -0 lines 0 comments Download
A components/contextual_search/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +48 lines, -0 lines 0 comments Download
A + components/contextual_search/DEPS View 1 2 3 4 5 6 7 8 9 10 0 chunks +-1 lines, --1 lines 0 comments Download
A components/contextual_search/OWNERS View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -0 lines 0 comments Download
A components/contextual_search/README View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -0 lines 0 comments Download
A + components/contextual_search/browser/DEPS View 1 2 3 4 5 6 7 8 9 10 0 chunks +-1 lines, --1 lines 0 comments Download
A components/contextual_search/browser/contextual_search_js_api_service_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +43 lines, -0 lines 0 comments Download
A components/contextual_search/browser/contextual_search_js_api_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +34 lines, -0 lines 0 comments Download
A components/contextual_search/browser/contextual_search_ui_handle.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +32 lines, -0 lines 0 comments Download
A components/contextual_search/common/contextual_search_js_api_service.mojom View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +15 lines, -0 lines 0 comments Download
A + components/contextual_search/common/overlay_page_notifier_service.mojom View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -4 lines 0 comments Download
A + components/contextual_search/renderer/DEPS View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +4 lines, -0 lines 0 comments Download
A components/contextual_search/renderer/contextual_search_wrapper.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +65 lines, -0 lines 0 comments Download
A components/contextual_search/renderer/contextual_search_wrapper.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +92 lines, -0 lines 0 comments Download
A components/contextual_search/renderer/overlay_js_render_frame_observer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +51 lines, -0 lines 0 comments Download
A components/contextual_search/renderer/overlay_js_render_frame_observer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +59 lines, -0 lines 0 comments Download
A components/contextual_search/renderer/overlay_page_notifier_service_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +41 lines, -0 lines 0 comments Download
A components/contextual_search/renderer/overlay_page_notifier_service_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 75 (25 generated)
Donn Denman
Kausalya, This is ready for a first-pass review now. PTAL. Note that I was unable ...
5 years, 2 months ago (2015-10-02 17:16:28 UTC) #2
Donn Denman
Kausalya, not sure if you already got this, so resending. This is ready for a ...
5 years, 2 months ago (2015-10-05 19:06:30 UTC) #3
kmadhusu
On 2015/10/05 19:06:30, Donn Denman wrote: > Kausalya, not sure if you already got this, ...
5 years, 2 months ago (2015-10-05 19:59:01 UTC) #4
Donn Denman
On 2015/10/05 19:59:01, kmadhusu wrote: > On 2015/10/05 19:06:30, Donn Denman wrote: > > Kausalya, ...
5 years, 2 months ago (2015-10-06 01:18:37 UTC) #5
jochen (gone - plz use gerrit)
https://chromiumcodereview.appspot.com/1385663002/diff/40001/chrome/renderer/contextualsearch/contextual_search_wrapper.cc File chrome/renderer/contextualsearch/contextual_search_wrapper.cc (right): https://chromiumcodereview.appspot.com/1385663002/diff/40001/chrome/renderer/contextualsearch/contextual_search_wrapper.cc#newcode73 chrome/renderer/contextualsearch/contextual_search_wrapper.cc:73: void ContextualSearchWrapper::SetCaption(gin::Arguments* args) { just use SetCaption(const std::string& caption) ...
5 years, 2 months ago (2015-10-07 13:49:26 UTC) #7
Donn Denman
Jochen, thanks for looking at this! PTAL at the renderer code. If you have suggestions ...
5 years, 2 months ago (2015-10-07 19:33:11 UTC) #9
kmadhusu
Thanks. https://chromiumcodereview.appspot.com/1385663002/diff/60001/chrome/browser/search/contextual_search_service.cc File chrome/browser/search/contextual_search_service.cc (right): https://chromiumcodereview.appspot.com/1385663002/diff/60001/chrome/browser/search/contextual_search_service.cc#newcode7 chrome/browser/search/contextual_search_service.cc:7: #include "base/memory/singleton.h" This header file is already included ...
5 years, 2 months ago (2015-10-08 22:05:02 UTC) #10
Donn Denman
Thanks for the review Kausalya! PTAL https://chromiumcodereview.appspot.com/1385663002/diff/60001/chrome/browser/search/contextual_search_service.cc File chrome/browser/search/contextual_search_service.cc (right): https://chromiumcodereview.appspot.com/1385663002/diff/60001/chrome/browser/search/contextual_search_service.cc#newcode7 chrome/browser/search/contextual_search_service.cc:7: #include "base/memory/singleton.h" On ...
5 years, 2 months ago (2015-10-09 20:46:43 UTC) #11
pedro (no code reviews)
Hey Donn. Sorry for the delay. https://codereview.chromium.org/1385663002/diff/60001/chrome/browser/search/contextual_search_service.h File chrome/browser/search/contextual_search_service.h (right): https://codereview.chromium.org/1385663002/diff/60001/chrome/browser/search/contextual_search_service.h#newcode39 chrome/browser/search/contextual_search_service.h:39: int process_id_; On ...
5 years, 2 months ago (2015-10-20 01:24:41 UTC) #12
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1385663002/diff/80001/chrome/renderer/contextualsearch/contextual_search_wrapper.cc File chrome/renderer/contextualsearch/contextual_search_wrapper.cc (right): https://codereview.chromium.org/1385663002/diff/80001/chrome/renderer/contextualsearch/contextual_search_wrapper.cc#newcode22 chrome/renderer/contextualsearch/contextual_search_wrapper.cc:22: v8::Local<v8::Object> GetOrCreateChromeObject(v8::Isolate* isolate, I'd move this to content/public/renderer/chrome_object_extensions_utils.h / ...
5 years, 2 months ago (2015-10-20 08:09:56 UTC) #13
Donn Denman
jochen and pedro, PTAL, and thanks for the reviews! https://codereview.chromium.org/1385663002/diff/60001/chrome/browser/search/contextual_search_service.h File chrome/browser/search/contextual_search_service.h (right): https://codereview.chromium.org/1385663002/diff/60001/chrome/browser/search/contextual_search_service.h#newcode39 chrome/browser/search/contextual_search_service.h:39: ...
5 years, 2 months ago (2015-10-20 21:56:46 UTC) #15
Donn Denman
Pedro, PTAL at this latest patch set. As we discussed f2f, one of your comments ...
5 years, 2 months ago (2015-10-21 20:02:05 UTC) #16
jochen (gone - plz use gerrit)
+creis for process management I'd rather not have new notification observers here. I also wonder ...
5 years, 2 months ago (2015-10-22 12:04:53 UTC) #18
Donn Denman
On 2015/10/22 12:04:53, jochen wrote: > +creis for process management > > I'd rather not ...
5 years, 1 month ago (2015-10-22 21:00:24 UTC) #19
Donn Denman
Pedro, PTAL. Removing the notification observer made the API controller a lot simpler, but shifted ...
5 years, 1 month ago (2015-10-22 21:01:27 UTC) #20
pedro (no code reviews)
lgtm LGTM for chrome/android and chrome/browser changes. I'll leave the renderer changes for the other ...
5 years, 1 month ago (2015-10-23 05:43:54 UTC) #21
Donn Denman
Kausalya and Charlie, PTAL. Pedro, thanks for the review! https://codereview.chromium.org/1385663002/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java File chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java (right): https://codereview.chromium.org/1385663002/diff/140001/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java#newcode233 chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/OverlayPanelContent.java:233: ...
5 years, 1 month ago (2015-10-23 18:58:07 UTC) #22
Donn Denman
Jochen and Charlie, here's a quick question for each of you. Thanks for the help! ...
5 years, 1 month ago (2015-10-28 00:26:56 UTC) #23
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1385663002/diff/160001/chrome/renderer/contextualsearch/contextual_search_wrapper.cc File chrome/renderer/contextualsearch/contextual_search_wrapper.cc (right): https://codereview.chromium.org/1385663002/diff/160001/chrome/renderer/contextualsearch/contextual_search_wrapper.cc#newcode63 chrome/renderer/contextualsearch/contextual_search_wrapper.cc:63: chrome->Set(gin::StringToV8(isolate, kContextualSearchObjectName), On 2015/10/28 at 00:26:56, Donn Denman wrote: ...
5 years, 1 month ago (2015-10-28 14:23:53 UTC) #24
Charlie Reis
https://codereview.chromium.org/1385663002/diff/160001/chrome/renderer/chrome_content_renderer_client.cc File chrome/renderer/chrome_content_renderer_client.cc (right): https://codereview.chromium.org/1385663002/diff/160001/chrome/renderer/chrome_content_renderer_client.cc#newcode520 chrome/renderer/chrome_content_renderer_client.cc:520: if (base::CommandLine::ForCurrentProcess()->HasSwitch( On 2015/10/28 00:26:56, Donn Denman wrote: > ...
5 years, 1 month ago (2015-10-28 19:51:44 UTC) #25
Donn Denman
Stuart, I'm adding a new component in the latest version of this CL, and I've ...
5 years, 1 month ago (2015-11-16 23:18:40 UTC) #29
stuartmorgan
My components experience is pretty light; if you're looking for high-quality feedback about the structure ...
5 years, 1 month ago (2015-11-16 23:45:28 UTC) #30
Donn Denman
Jochen, Please take another look at this CL. It has changed significantly, but the wrapper ...
5 years, 1 month ago (2015-11-17 00:24:24 UTC) #32
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1385663002/diff/180001/components/contextual_search/DEPS File components/contextual_search/DEPS (right): https://codereview.chromium.org/1385663002/diff/180001/components/contextual_search/DEPS#newcode2 components/contextual_search/DEPS:2: "+content/public", please don't mix browser and renderer code. Instead, ...
5 years, 1 month ago (2015-11-17 14:58:12 UTC) #33
Donn Denman
Jochen, PTAL, and thank you very much for the review! https://codereview.chromium.org/1385663002/diff/180001/components/contextual_search/DEPS File components/contextual_search/DEPS (right): https://codereview.chromium.org/1385663002/diff/180001/components/contextual_search/DEPS#newcode2 ...
5 years, 1 month ago (2015-11-19 01:11:29 UTC) #34
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1385663002/diff/180001/components/contextual_search/contextual_search_wrapper.cc File components/contextual_search/contextual_search_wrapper.cc (right): https://codereview.chromium.org/1385663002/diff/180001/components/contextual_search/contextual_search_wrapper.cc#newcode24 components/contextual_search/contextual_search_wrapper.cc:24: // TODO(donnd): merge with the identical code in On ...
5 years, 1 month ago (2015-11-19 09:22:18 UTC) #35
Donn Denman
Matt, would you mind taking a look? Thanks! https://codereview.chromium.org/1385663002/diff/180001/components/contextual_search/contextual_search_wrapper.cc File components/contextual_search/contextual_search_wrapper.cc (right): https://codereview.chromium.org/1385663002/diff/180001/components/contextual_search/contextual_search_wrapper.cc#newcode24 components/contextual_search/contextual_search_wrapper.cc:24: // ...
5 years, 1 month ago (2015-11-19 17:48:04 UTC) #37
mdjones
https://codereview.chromium.org/1385663002/diff/200001/chrome/browser/BUILD.gn File chrome/browser/BUILD.gn (right): https://codereview.chromium.org/1385663002/diff/200001/chrome/browser/BUILD.gn#newcode116 chrome/browser/BUILD.gn:116: "//components/contextual_search:browser", Shouldn't this be in the non-iOS section below? ...
5 years, 1 month ago (2015-11-19 20:31:24 UTC) #38
Donn Denman
Dr Jones, PTAL, and thanks for the review! https://codereview.chromium.org/1385663002/diff/200001/chrome/browser/BUILD.gn File chrome/browser/BUILD.gn (right): https://codereview.chromium.org/1385663002/diff/200001/chrome/browser/BUILD.gn#newcode116 chrome/browser/BUILD.gn:116: "//components/contextual_search:browser", ...
5 years, 1 month ago (2015-11-20 00:01:41 UTC) #40
mdjones
lgtm
5 years, 1 month ago (2015-11-20 17:48:47 UTC) #41
Donn Denman
Jochen, PTAL. I added another parameter to the setCaption API call, and updated the code ...
5 years, 1 month ago (2015-11-20 22:22:21 UTC) #42
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1385663002/diff/240001/chrome/browser/DEPS File chrome/browser/DEPS (right): https://codereview.chromium.org/1385663002/diff/240001/chrome/browser/DEPS#newcode34 chrome/browser/DEPS:34: "+components/contextual_search", restrict to /browser https://codereview.chromium.org/1385663002/diff/240001/chrome/renderer/DEPS File chrome/renderer/DEPS (right): https://codereview.chromium.org/1385663002/diff/240001/chrome/renderer/DEPS#newcode9 ...
5 years ago (2015-11-24 10:43:35 UTC) #43
Donn Denman
Jochen, thanks for the review! Does it look like I'm taking the approach you suggested ...
5 years ago (2015-12-02 03:32:48 UTC) #45
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1385663002/diff/260001/components/contextual_search/renderer/contextual_search_wrapper.cc File components/contextual_search/renderer/contextual_search_wrapper.cc (right): https://codereview.chromium.org/1385663002/diff/260001/components/contextual_search/renderer/contextual_search_wrapper.cc#newcode53 components/contextual_search/renderer/contextual_search_wrapper.cc:53: gin::CreateHandle(isolate, result.get()); CreateHandle() passes ownership of the object to ...
5 years ago (2015-12-02 12:59:15 UTC) #46
Donn Denman
Jochen, PTAL, I feel like this is getting close. There just seems to be one ...
5 years ago (2015-12-03 01:21:09 UTC) #47
Donn Denman
On 2015/12/03 01:21:09, Donn Denman wrote: > Jochen, PTAL, I feel like this is getting ...
5 years ago (2015-12-03 23:57:23 UTC) #48
jochen (gone - plz use gerrit)
https://codereview.chromium.org/1385663002/diff/280001/components/contextual_search/renderer/contextual_search_wrapper.cc File components/contextual_search/renderer/contextual_search_wrapper.cc (right): https://codereview.chromium.org/1385663002/diff/280001/components/contextual_search/renderer/contextual_search_wrapper.cc#newcode59 components/contextual_search/renderer/contextual_search_wrapper.cc:59: wrapped_object->SetGinHandle(wrapper); don't hold on to the wrapper https://codereview.chromium.org/1385663002/diff/280001/components/contextual_search/renderer/contextual_search_wrapper.cc#newcode78 components/contextual_search/renderer/contextual_search_wrapper.cc:78: ...
5 years ago (2015-12-04 13:21:36 UTC) #49
Donn Denman
Jochen, PTAL. Sorry you needed to point out that needed cleanup in my previous patch. ...
5 years ago (2015-12-09 00:57:33 UTC) #50
jochen (gone - plz use gerrit)
lgtm
5 years ago (2015-12-09 15:40:29 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1385663002/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1385663002/300001
5 years ago (2015-12-09 17:33:25 UTC) #54
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/168609) chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, ...
5 years ago (2015-12-09 17:40:01 UTC) #56
Donn Denman
yzshen@, can you give OWNERS approval for including mojo/public in our DEPS in this new ...
5 years ago (2015-12-09 23:24:12 UTC) #58
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1385663002/320001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1385663002/320001
5 years ago (2015-12-09 23:26:04 UTC) #61
commit-bot: I haz the power
Try jobs failed on following builders: android_chromium_gn_compile_dbg on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_dbg/builds/151764) android_chromium_gn_compile_rel on tryserver.chromium.linux (JOB_FAILED, ...
5 years ago (2015-12-09 23:37:35 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1385663002/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1385663002/340001
5 years ago (2015-12-09 23:48:44 UTC) #66
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/127320)
5 years ago (2015-12-10 00:05:51 UTC) #68
yzshen1
On 2015/12/10 00:05:51, commit-bot: I haz the power wrote: > Try jobs failed on following ...
5 years ago (2015-12-10 20:15:16 UTC) #69
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1385663002/340001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1385663002/340001
5 years ago (2015-12-10 20:24:05 UTC) #71
commit-bot: I haz the power
Committed patchset #18 (id:340001)
5 years ago (2015-12-10 20:39:16 UTC) #73
commit-bot: I haz the power
5 years ago (2015-12-10 20:40:10 UTC) #75
Message was sent while issue was closed.
Patchset 18 (id:??) landed as
https://crrev.com/bda9b6f432fb237029ed6f4fac16bbe30da0cde4
Cr-Commit-Position: refs/heads/master@{#364460}

Powered by Google App Engine
This is Rietveld 408576698