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

Issue 2894553002: Replace OnPageTranslate Obsever by a responder of delegate. (Closed)

Created:
3 years, 7 months ago by Leo
Modified:
3 years, 7 months ago
Reviewers:
napper, groby-ooo-7-16
CC:
chromium-reviews, clingon_google.com
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Replace OnPageTranslate Observer by a responder of delegate. In order to be notified that page is translated, we simply implement CompactInfobar as observer of Translate Driver. But now we found from the translate button is clicked to the page is translated, there are many steps. If any step is returned, we are not be notified at all. In order to fix the loose relationship, we create a responder inside the delegate. So no matter what delegate is going to do, we will be notified, which keep infobar always consistent with delegate. What's more, on some corner cases listed in bug/723426, the relationship between infobar and translate driver causes crash. And the new strong relationship will fix it. BUG=720164, 703887, 723426, 724428 TBR=dfalcantara@chromium.org Review-Url: https://codereview.chromium.org/2894553002 Cr-Commit-Position: refs/heads/master@{#473799} Committed: https://chromium.googlesource.com/chromium/src/+/e65dd51e10accc80aa2be79129912f47357cb958

Patch Set 1 #

Total comments: 14

Patch Set 2 : fix #

Total comments: 20

Patch Set 3 : Fix Comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -37 lines) Patch
M chrome/browser/ui/android/infobars/translate_compact_infobar.h View 1 2 4 chunks +21 lines, -7 lines 0 comments Download
M chrome/browser/ui/android/infobars/translate_compact_infobar.cc View 1 2 6 chunks +26 lines, -21 lines 0 comments Download
M components/translate/core/browser/translate_infobar_delegate.h View 1 2 3 chunks +20 lines, -0 lines 0 comments Download
M components/translate/core/browser/translate_infobar_delegate.cc View 1 2 4 chunks +22 lines, -9 lines 0 comments Download

Messages

Total messages: 31 (18 generated)
Leo
This CL is used to fix a no-connection bug. PLTA. Thanks
3 years, 7 months ago (2017-05-18 08:19:47 UTC) #5
Leo
+ napper and cc clingon
3 years, 7 months ago (2017-05-18 23:39:47 UTC) #9
napper
https://codereview.chromium.org/2894553002/diff/1/chrome/browser/ui/android/infobars/translate_compact_infobar.cc File chrome/browser/ui/android/infobars/translate_compact_infobar.cc (right): https://codereview.chromium.org/2894553002/diff/1/chrome/browser/ui/android/infobars/translate_compact_infobar.cc#newcode23 chrome/browser/ui/android/infobars/translate_compact_infobar.cc:23: TranslateCompactInfoBar::TranslateCompactInfoBar( Dont you need to initialize action_flags_ here? https://codereview.chromium.org/2894553002/diff/1/chrome/browser/ui/android/infobars/translate_compact_infobar.cc#newcode161 ...
3 years, 7 months ago (2017-05-19 00:17:50 UTC) #10
Leo
Thanks John. PTAL. Great to learn the C++ technique from your comments. https://codereview.chromium.org/2894553002/diff/1/chrome/browser/ui/android/infobars/translate_compact_infobar.cc File chrome/browser/ui/android/infobars/translate_compact_infobar.cc ...
3 years, 7 months ago (2017-05-19 03:30:24 UTC) #12
Leo
Thanks John. PTAL. Great to learn the C++ technique from your comments. https://codereview.chromium.org/2894553002/diff/1/chrome/browser/ui/android/infobars/translate_compact_infobar.cc File chrome/browser/ui/android/infobars/translate_compact_infobar.cc ...
3 years, 7 months ago (2017-05-19 03:30:24 UTC) #13
groby-ooo-7-16
https://codereview.chromium.org/2894553002/diff/20001/chrome/browser/ui/android/infobars/translate_compact_infobar.cc File chrome/browser/ui/android/infobars/translate_compact_infobar.cc (right): https://codereview.chromium.org/2894553002/diff/20001/chrome/browser/ui/android/infobars/translate_compact_infobar.cc#newcode65 chrome/browser/ui/android/infobars/translate_compact_infobar.cc:65: action_flags_ |= FLAG_TRANSLATE; SHould this flag be traced on ...
3 years, 7 months ago (2017-05-20 21:30:39 UTC) #16
Leo
Thanks a lot for the reviewing. I replied on some crucial comments first. Hope these ...
3 years, 7 months ago (2017-05-21 04:15:20 UTC) #17
napper
https://codereview.chromium.org/2894553002/diff/20001/chrome/browser/ui/android/infobars/translate_compact_infobar.h File chrome/browser/ui/android/infobars/translate_compact_infobar.h (right): https://codereview.chromium.org/2894553002/diff/20001/chrome/browser/ui/android/infobars/translate_compact_infobar.h#newcode65 chrome/browser/ui/android/infobars/translate_compact_infobar.h:65: unsigned int action_flags_; On 2017/05/20 at 21:30:39, groby wrote: ...
3 years, 7 months ago (2017-05-21 23:24:16 UTC) #18
Leo
Hey Rachel, Sorry for my long sentences but just want to explain my idea clearer. ...
3 years, 7 months ago (2017-05-22 09:08:10 UTC) #19
groby-ooo-7-16
The code itself is lgtm I would very much appreciate it if you could add ...
3 years, 7 months ago (2017-05-22 14:34:11 UTC) #20
Leo
On 2017/05/22 14:34:11, groby wrote: > The code itself is lgtm > > I would ...
3 years, 7 months ago (2017-05-23 01:42:49 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2894553002/40001
3 years, 7 months ago (2017-05-23 03:17:40 UTC) #28
commit-bot: I haz the power
3 years, 7 months ago (2017-05-23 03:22:06 UTC) #31
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/e65dd51e10accc80aa2be7912991...

Powered by Google App Engine
This is Rietveld 408576698