OLD | NEW |
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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } // namespace | 79 } // namespace |
80 | 80 |
81 DEFINE_WEB_CONTENTS_USER_DATA_KEY(ChromeTranslateClient); | 81 DEFINE_WEB_CONTENTS_USER_DATA_KEY(ChromeTranslateClient); |
82 | 82 |
83 ChromeTranslateClient::ChromeTranslateClient(content::WebContents* web_contents) | 83 ChromeTranslateClient::ChromeTranslateClient(content::WebContents* web_contents) |
84 : content::WebContentsObserver(web_contents), | 84 : content::WebContentsObserver(web_contents), |
85 max_reload_check_attempts_(kMaxTranslateLoadCheckAttempts), | 85 max_reload_check_attempts_(kMaxTranslateLoadCheckAttempts), |
86 translate_driver_(&web_contents->GetController()), | 86 translate_driver_(&web_contents->GetController()), |
87 translate_manager_(new TranslateManager(this, prefs::kAcceptLanguages)), | 87 translate_manager_(new TranslateManager(this, prefs::kAcceptLanguages)), |
88 cld_data_provider_(translate::CreateBrowserCldDataProviderFor( | 88 cld_data_provider_(translate::CreateBrowserCldDataProviderFor( |
89 web_contents->GetRenderViewHost())), | 89 web_contents)), |
90 weak_pointer_factory_(this) { | 90 weak_pointer_factory_(this) { |
91 #if defined(CLD_DATA_FROM_STANDALONE) | 91 #if defined(CLD_DATA_FROM_STANDALONE) |
92 if (!g_cld_file_path_initialized_) | 92 if (!g_cld_file_path_initialized_) |
93 InitCldFilePath(); | 93 InitCldFilePath(); |
94 #endif | 94 #endif |
95 } | 95 } |
96 | 96 |
97 ChromeTranslateClient::~ChromeTranslateClient() { | 97 ChromeTranslateClient::~ChromeTranslateClient() { |
98 } | 98 } |
99 | 99 |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 if (GetLanguageState().InTranslateNavigation()) | 449 if (GetLanguageState().InTranslateNavigation()) |
450 return; | 450 return; |
451 } | 451 } |
452 | 452 |
453 TranslateBubbleFactory::Show( | 453 TranslateBubbleFactory::Show( |
454 browser->window(), web_contents(), step, error_type); | 454 browser->window(), web_contents(), step, error_type); |
455 #else | 455 #else |
456 NOTREACHED(); | 456 NOTREACHED(); |
457 #endif | 457 #endif |
458 } | 458 } |
OLD | NEW |