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

Issue 2602003: Refactored the translate infobars. (Closed)

Created:
10 years, 6 months ago by Jay Civelli
Modified:
9 years, 7 months ago
Reviewers:
jeremy, kuan
CC:
Elliot Glaysher, chromium-reviews, tfarina
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

Refactored the translate infobars. Since some work is needed on Linux and Mac to use the new translate infobar delegate, I created a new version of the refactored classes instead of replacing them. Once Linux and Mac use the new classes, we can make the swicth. The TranslateInfoBarDelegate now contains all states, so there is no more logic on the infobar classes. I broke down the single infobar class into multiple ones (there is now an infobar for each state: before translate, translating, after translate, error): it makes the code simpler. I had to fix ReplaceInfoBar on Windows as it was not working properly. BUG=40828 TEST=Test thoroughly the translate feature. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=49307

Patch Set 1 #

Total comments: 53

Patch Set 2 : Addressing review's comments #

Patch Set 3 : Fixing the LInux/Mac builds #

Patch Set 4 : Attempting to fix Mac and Linux builds #

Patch Set 5 : Synced #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3651 lines, -217 lines) Patch
M app/l10n_util.h View 1 chunk +3 lines, -0 lines 0 comments Download
M app/l10n_util.cc View 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/app/generated_resources.grd View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/browser_main.cc View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/infobar_delegate.h View 2 chunks +4 lines, -0 lines 0 comments Download
M chrome/browser/tab_contents/render_view_context_menu.cc View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
A chrome/browser/translate/languages_menu_model2.h View 1 1 chunk +40 lines, -0 lines 0 comments Download
A chrome/browser/translate/languages_menu_model2.cc View 1 chunk +49 lines, -0 lines 0 comments Download
M chrome/browser/translate/options_menu_model.h View 1 chunk +10 lines, -2 lines 0 comments Download
M chrome/browser/translate/options_menu_model.cc View 3 chunks +17 lines, -1 line 0 comments Download
A chrome/browser/translate/options_menu_model2.h View 1 chunk +36 lines, -0 lines 0 comments Download
A chrome/browser/translate/options_menu_model2.cc View 1 1 chunk +114 lines, -0 lines 0 comments Download
A chrome/browser/translate/translate_infobar_delegate2.h View 1 2 3 1 chunk +178 lines, -0 lines 0 comments Download
A chrome/browser/translate/translate_infobar_delegate2.cc View 1 2 3 4 1 chunk +305 lines, -0 lines 0 comments Download
A chrome/browser/translate/translate_infobar_view.h View 1 1 chunk +19 lines, -0 lines 0 comments Download
A chrome/browser/translate/translate_manager2.h View 1 chunk +170 lines, -0 lines 0 comments Download
A chrome/browser/translate/translate_manager2.cc View 1 2 1 chunk +549 lines, -0 lines 0 comments Download
A chrome/browser/translate/translate_manager2_unittest.cc View 1 chunk +999 lines, -0 lines 0 comments Download
A chrome/browser/views/infobars/after_translate_infobar.h View 1 1 chunk +82 lines, -0 lines 0 comments Download
A chrome/browser/views/infobars/after_translate_infobar.cc View 1 2 3 4 1 chunk +170 lines, -0 lines 0 comments Download
A chrome/browser/views/infobars/before_translate_infobar.h View 1 1 chunk +76 lines, -0 lines 0 comments Download
A chrome/browser/views/infobars/before_translate_infobar.cc View 1 2 3 4 1 chunk +137 lines, -0 lines 0 comments Download
A chrome/browser/views/infobars/infobar_button_border.h View 1 1 chunk +52 lines, -0 lines 0 comments Download
A chrome/browser/views/infobars/infobar_button_border.cc View 1 1 chunk +142 lines, -0 lines 0 comments Download
A chrome/browser/views/infobars/infobar_text_button.h View 1 chunk +35 lines, -0 lines 0 comments Download
A chrome/browser/views/infobars/infobar_text_button.cc View 1 chunk +50 lines, -0 lines 0 comments Download
M chrome/browser/views/infobars/infobars.cc View 1 chunk +4 lines, -1 line 0 comments Download
A chrome/browser/views/infobars/translate_infobar_base.h View 1 2 1 chunk +76 lines, -0 lines 0 comments Download
A chrome/browser/views/infobars/translate_infobar_base.cc View 1 2 1 chunk +179 lines, -0 lines 0 comments Download
M chrome/browser/views/infobars/translate_infobars.h View 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/views/infobars/translate_infobars.cc View 6 chunks +9 lines, -204 lines 0 comments Download
A chrome/browser/views/infobars/translate_message_infobar.h View 1 1 chunk +28 lines, -0 lines 0 comments Download
A chrome/browser/views/infobars/translate_message_infobar.cc View 1 chunk +57 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 2 chunks +21 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 chunks +7 lines, -4 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Jay Civelli
10 years, 6 months ago (2010-06-03 23:54:49 UTC) #1
tfarina
Jay, I made some minor comments below (also I looked only yet in those header ...
10 years, 6 months ago (2010-06-03 23:59:05 UTC) #2
jeremy
Thanks for doing this! Q: Are we planning on redoing the UI for the translate ...
10 years, 6 months ago (2010-06-06 11:53:00 UTC) #3
kuan
LGTM. http://codereview.chromium.org/2602003/diff/1/5 File chrome/browser/tab_contents/render_view_context_menu.cc (right): http://codereview.chromium.org/2602003/diff/1/5#newcode38 chrome/browser/tab_contents/render_view_context_menu.cc:38: #include "chrome/browser/translate/translate_manager2.h" do u need #if defined(OS_WIN) here? ...
10 years, 6 months ago (2010-06-07 19:48:53 UTC) #4
Jay Civelli
All comments addressed. Jeremy, to answer your question, the UI is going to be mostly ...
10 years, 6 months ago (2010-06-07 21:30:43 UTC) #5
jeremy
10 years, 6 months ago (2010-06-08 07:40:26 UTC) #6
LGTM

http://codereview.chromium.org/2602003/diff/1/12
File chrome/browser/translate/translate_infobar_delegate2.cc (right):

http://codereview.chromium.org/2602003/diff/1/12#newcode22
chrome/browser/translate/translate_infobar_delegate2.cc:22: const std::string&
original_language,
Can you mention that these are ASCII encoded in the comment too or if your
feeling really adventurous suffix the variable names with _ascii :) Though I'm
not sure if there's precedence for doing that...

Powered by Google App Engine
This is Rietveld 408576698