| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void InitCldFilePath() { | 65 void InitCldFilePath() { |
| 66 VLOG(1) << "Initializing CLD file path for the first time."; | 66 VLOG(1) << "Initializing CLD file path for the first time."; |
| 67 base::FilePath path; | 67 base::FilePath path; |
| 68 if (!PathService::Get(chrome::DIR_USER_DATA, &path)) { | 68 if (!PathService::Get(chrome::DIR_USER_DATA, &path)) { |
| 69 LOG(WARNING) << "Unable to locate user data directory"; | 69 LOG(WARNING) << "Unable to locate user data directory"; |
| 70 return; // Chrome isn't properly installed | 70 return; // Chrome isn't properly installed |
| 71 } | 71 } |
| 72 g_cld_file_path_initialized_ = true; | 72 g_cld_file_path_initialized_ = true; |
| 73 path = path.Append(kCldDataFileName); | 73 path = path.Append(kCldDataFileName); |
| 74 VLOG(1) << "Setting CLD data file path: " << path.value(); | 74 VLOG(1) << "Setting CLD data file path: " << path.value(); |
| 75 translate::DataFileBrowserCldDataProvider::SetCldDataFilePath(path); | 75 translate::SetCldDataFilePath(path); |
| 76 } | 76 } |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 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), |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 if (GetLanguageState().InTranslateNavigation()) | 460 if (GetLanguageState().InTranslateNavigation()) |
| 461 return; | 461 return; |
| 462 } | 462 } |
| 463 | 463 |
| 464 TranslateBubbleFactory::Show( | 464 TranslateBubbleFactory::Show( |
| 465 browser->window(), web_contents(), step, error_type); | 465 browser->window(), web_contents(), step, error_type); |
| 466 #else | 466 #else |
| 467 NOTREACHED(); | 467 NOTREACHED(); |
| 468 #endif | 468 #endif |
| 469 } | 469 } |
| OLD | NEW |