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

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

Issue 354093004: Fix crash when using non-static CLD and update translate.gypi (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase onto master Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | components/translate.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « no previous file | components/translate.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698