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

Issue 166963002: TranslateManager is no longer a singleton (Closed)

Created:
6 years, 10 months ago by droger
Modified:
6 years, 10 months ago
Reviewers:
MAD, brettw, blundell
CC:
chromium-reviews, Avi (use Gerrit), creis+watch_chromium.org, ajwong+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@temp
Visibility:
Public.

Description

TranslateManager is no longer a singleton There is now a TranslateManager per tab. TranslateManager is owned by TranslateTabHelper. This changes simplifies all the tracking of WebContents objects, since there is now one and only one WebContents per TranslateManager. This allows to get rid of all the |web_contents| parameters as well as the PendingRequest type. Users of the TranslateManager now get a manager from a WebContents object, through the associated TranslateTabHelper. BUG=332736 TBR=brettw Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=252098

Patch Set 1 : . #

Patch Set 2 : rebase #

Total comments: 11

Patch Set 3 : Review comments #

Total comments: 20

Patch Set 4 : Rebase + review comments #

Total comments: 11

Patch Set 5 : review comments #

Patch Set 6 : Fix TODO comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+208 lines, -207 lines) Patch
M chrome/browser/tab_contents/render_view_context_menu.cc View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M chrome/browser/translate/translate_infobar_delegate.cc View 1 2 3 2 chunks +9 lines, -4 lines 0 comments Download
M chrome/browser/translate/translate_manager.h View 1 2 3 4 5 chunks +23 lines, -43 lines 0 comments Download
M chrome/browser/translate/translate_manager.cc View 1 2 3 19 chunks +96 lines, -124 lines 0 comments Download
M chrome/browser/translate/translate_manager_browsertest.cc View 1 2 3 2 chunks +12 lines, -11 lines 0 comments Download
M chrome/browser/translate/translate_service.cc View 1 2 3 4 2 chunks +0 lines, -3 lines 0 comments Download
M chrome/browser/translate/translate_tab_helper.h View 1 2 3 5 chunks +17 lines, -4 lines 0 comments Download
M chrome/browser/translate/translate_tab_helper.cc View 1 2 3 4 5 8 chunks +40 lines, -12 lines 0 comments Download
M chrome/browser/translate/translate_ui_delegate.cc View 1 2 3 1 chunk +8 lines, -4 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
droger
TranslateManager is owned directly by TranslateTabHelper (aka ChromeTranslateClient), and not by the driver as we ...
6 years, 10 months ago (2014-02-17 13:18:15 UTC) #1
blundell
TranslateTabHelper::GetWebContents() can return NULL (when the WebContents is going away), so you either need to ...
6 years, 10 months ago (2014-02-17 15:26:28 UTC) #2
droger
I applied your comments, and as discussed offline added back the existing checks where applicable. ...
6 years, 10 months ago (2014-02-17 16:52:48 UTC) #3
blundell
LGTM with a bunch of nits. Thanks! https://codereview.chromium.org/166963002/diff/320001/chrome/browser/translate/translate_infobar_delegate.cc File chrome/browser/translate/translate_infobar_delegate.cc (right): https://codereview.chromium.org/166963002/diff/320001/chrome/browser/translate/translate_infobar_delegate.cc#newcode134 chrome/browser/translate/translate_infobar_delegate.cc:134: TranslateTabHelper::GetManagerFromWebContents(web_contents()) You ...
6 years, 10 months ago (2014-02-18 09:21:46 UTC) #4
droger
Thanks for the review. https://codereview.chromium.org/166963002/diff/320001/chrome/browser/translate/translate_infobar_delegate.cc File chrome/browser/translate/translate_infobar_delegate.cc (right): https://codereview.chromium.org/166963002/diff/320001/chrome/browser/translate/translate_infobar_delegate.cc#newcode134 chrome/browser/translate/translate_infobar_delegate.cc:134: TranslateTabHelper::GetManagerFromWebContents(web_contents()) On 2014/02/18 09:21:46, blundell ...
6 years, 10 months ago (2014-02-18 10:16:51 UTC) #5
droger
+mad
6 years, 10 months ago (2014-02-18 10:54:17 UTC) #6
MAD
Très cool... Very well done! Thanks again... A few minor comments/questions/nits... BYE MAD https://codereview.chromium.org/166963002/diff/430002/chrome/browser/translate/translate_infobar_delegate.cc File ...
6 years, 10 months ago (2014-02-18 20:29:12 UTC) #7
droger
https://codereview.chromium.org/166963002/diff/430002/chrome/browser/translate/translate_infobar_delegate.cc File chrome/browser/translate/translate_infobar_delegate.cc (right): https://codereview.chromium.org/166963002/diff/430002/chrome/browser/translate/translate_infobar_delegate.cc#newcode136 chrome/browser/translate/translate_infobar_delegate.cc:136: if (!manager) On 2014/02/18 20:29:12, MAD wrote: > Why ...
6 years, 10 months ago (2014-02-19 09:17:28 UTC) #8
MAD
OK, LGTM, conditional to updating the TODO comment text. Thanks! BYE MAD https://codereview.chromium.org/166963002/diff/430002/chrome/browser/translate/translate_infobar_delegate.cc File chrome/browser/translate/translate_infobar_delegate.cc ...
6 years, 10 months ago (2014-02-19 16:22:07 UTC) #9
droger
TBR brettw as OWNER of chrome/browser/tab_contents/render_view_context_menu.cc
6 years, 10 months ago (2014-02-19 16:36:45 UTC) #10
droger
The CQ bit was checked by droger@chromium.org
6 years, 10 months ago (2014-02-19 16:38:19 UTC) #11
droger
https://codereview.chromium.org/166963002/diff/430002/chrome/browser/translate/translate_infobar_delegate.cc File chrome/browser/translate/translate_infobar_delegate.cc (right): https://codereview.chromium.org/166963002/diff/430002/chrome/browser/translate/translate_infobar_delegate.cc#newcode136 chrome/browser/translate/translate_infobar_delegate.cc:136: if (!manager) On 2014/02/19 16:22:07, MAD wrote: > OK, ...
6 years, 10 months ago (2014-02-19 16:40:08 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/droger@chromium.org/166963002/760001
6 years, 10 months ago (2014-02-19 16:41:05 UTC) #13
commit-bot: I haz the power
6 years, 10 months ago (2014-02-19 21:18:42 UTC) #14
Message was sent while issue was closed.
Change committed as 252098

Powered by Google App Engine
This is Rietveld 408576698