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

Side by Side Diff: chrome/browser/translate/chrome_translate_client.cc

Issue 1923143003: Implement the 2016Q2 Translate UI designe spec out in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix namespace in .h and other minor review comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/translate/chrome_translate_client.h" 5 #include "chrome/browser/translate/chrome_translate_client.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 error_type, 197 error_type,
198 triggered_from_menu); 198 triggered_from_menu);
199 return; 199 return;
200 } 200 }
201 #endif 201 #endif
202 202
203 // Bubble UI. 203 // Bubble UI.
204 if (step == translate::TRANSLATE_STEP_BEFORE_TRANSLATE) { 204 if (step == translate::TRANSLATE_STEP_BEFORE_TRANSLATE) {
205 // TODO(droger): Move this logic out of UI code. 205 // TODO(droger): Move this logic out of UI code.
206 GetLanguageState().SetTranslateEnabled(true); 206 GetLanguageState().SetTranslateEnabled(true);
207 if (!GetLanguageState().HasLanguageChanged()) 207 if (!base::FeatureList::IsEnabled(translate::kTranslateUI2016Q2)) {
msw 2016/04/29 19:59:59 nit: combine with nested if statement using &&...
ftang 2016/04/29 22:37:00 Done.
208 return; 208 if (!GetLanguageState().HasLanguageChanged())
209 return;
210 }
209 211
210 if (!triggered_from_menu) { 212 if (!triggered_from_menu) {
211 if (web_contents()->GetBrowserContext()->IsOffTheRecord()) 213 if (web_contents()->GetBrowserContext()->IsOffTheRecord())
212 return; 214 return;
213 if (GetTranslatePrefs()->IsTooOftenDenied(source_language)) 215 if (GetTranslatePrefs()->IsTooOftenDenied(source_language))
214 return; 216 return;
215 } 217 }
216 } 218 }
217 ShowBubble(step, error_type); 219 ShowBubble(step, error_type);
218 } 220 }
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 if (GetLanguageState().InTranslateNavigation()) 342 if (GetLanguageState().InTranslateNavigation())
341 return; 343 return;
342 } 344 }
343 345
344 TranslateBubbleFactory::Show( 346 TranslateBubbleFactory::Show(
345 browser->window(), web_contents(), step, error_type); 347 browser->window(), web_contents(), step, error_type);
346 #else 348 #else
347 NOTREACHED(); 349 NOTREACHED();
348 #endif 350 #endif
349 } 351 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698