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

Unified Diff: chrome/browser/extensions/api/tabs/tabs_api.cc

Issue 14494004: Added the 'Translation Logs' tab to chrome://translate-internals/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (Rebasing) Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/tabs/tabs_api.cc
diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
index 650b8744550d13e90a31b29ad2ce5f23af16bb9c..0eb15dd28d443591df825ebd162e73b04a1da1d2 100644
--- a/chrome/browser/extensions/api/tabs/tabs_api.cc
+++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
@@ -61,6 +61,7 @@
#include "chrome/common/extensions/incognito_handler.h"
#include "chrome/common/extensions/message_bundle.h"
#include "chrome/common/extensions/user_script.h"
+#include "chrome/common/language_detection_details.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "components/user_prefs/pref_registry_syncable.h"
@@ -1925,8 +1926,11 @@ void TabsDetectLanguageFunction::Observe(
const content::NotificationSource& source,
const content::NotificationDetails& details) {
std::string language;
- if (type == chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED)
- language = *content::Details<std::string>(details).ptr();
+ if (type == chrome::NOTIFICATION_TAB_LANGUAGE_DETERMINED) {
+ const LanguageDetectionDetails* lang_det_details =
+ content::Details<const LanguageDetectionDetails>(details).ptr();
+ language = lang_det_details->adopted_language;
+ }
registrar_.RemoveAll();

Powered by Google App Engine
This is Rietveld 408576698