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

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

Issue 1398823004: Switch the page-capturing machinery to use the new hooks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 // Translation process can be interrupted. 270 // Translation process can be interrupted.
271 // Destroying the TranslateManager now guarantees that it never has to deal 271 // Destroying the TranslateManager now guarantees that it never has to deal
272 // with NULL WebContents. 272 // with NULL WebContents.
273 translate_manager_.reset(); 273 translate_manager_.reset();
274 } 274 }
275 275
276 // ContentTranslateDriver::Observer implementation. 276 // ContentTranslateDriver::Observer implementation.
277 277
278 void ChromeTranslateClient::OnLanguageDetermined( 278 void ChromeTranslateClient::OnLanguageDetermined(
279 const translate::LanguageDetectionDetails& details) { 279 const translate::LanguageDetectionDetails& details) {
280 // LOG(INFO) << "Language Detected: " << details.adopted_language;
280 // TODO: Remove translate notifications and have the clients be 281 // TODO: Remove translate notifications and have the clients be
281 // ContentTranslateDriver::Observer directly instead. 282 // ContentTranslateDriver::Observer directly instead.
282 content::NotificationService::current()->Notify( 283 content::NotificationService::current()->Notify(
283 chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED, 284 chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED,
284 content::Source<content::WebContents>(web_contents()), 285 content::Source<content::WebContents>(web_contents()),
285 content::Details<const translate::LanguageDetectionDetails>(&details)); 286 content::Details<const translate::LanguageDetectionDetails>(&details));
286 } 287 }
287 288
288 void ChromeTranslateClient::OnPageTranslated( 289 void ChromeTranslateClient::OnPageTranslated(
289 const std::string& original_lang, 290 const std::string& original_lang,
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 if (GetLanguageState().InTranslateNavigation()) 336 if (GetLanguageState().InTranslateNavigation())
336 return; 337 return;
337 } 338 }
338 339
339 TranslateBubbleFactory::Show( 340 TranslateBubbleFactory::Show(
340 browser->window(), web_contents(), step, error_type); 341 browser->window(), web_contents(), step, error_type);
341 #else 342 #else
342 NOTREACHED(); 343 NOTREACHED();
343 #endif 344 #endif
344 } 345 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698