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

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

Issue 292513002: Remove dependency of TranslateInfobarDelegate on chrome/ and content/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/translate_tab_helper.h" 5 #include "chrome/browser/translate/translate_tab_helper.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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // TODO(droger): Move this logic out of UI code. 167 // TODO(droger): Move this logic out of UI code.
168 GetLanguageState().SetTranslateEnabled(true); 168 GetLanguageState().SetTranslateEnabled(true);
169 if (!GetLanguageState().HasLanguageChanged()) 169 if (!GetLanguageState().HasLanguageChanged())
170 return; 170 return;
171 } 171 }
172 ShowBubble(step, error_type); 172 ShowBubble(step, error_type);
173 return; 173 return;
174 } 174 }
175 175
176 // Infobar UI. 176 // Infobar UI.
177 Profile* profile =
178 Profile::FromBrowserContext(web_contents()->GetBrowserContext());
179 Profile* original_profile = profile->GetOriginalProfile();
180 TranslateInfoBarDelegate::Create( 177 TranslateInfoBarDelegate::Create(
181 step != translate::TRANSLATE_STEP_BEFORE_TRANSLATE, 178 step != translate::TRANSLATE_STEP_BEFORE_TRANSLATE,
182 translate_manager_->GetWeakPtr(), 179 translate_manager_->GetWeakPtr(),
183 InfoBarService::FromWebContents(web_contents()), 180 InfoBarService::FromWebContents(web_contents()),
184 profile->IsOffTheRecord(), 181 web_contents()->GetBrowserContext()->IsOffTheRecord(),
185 step, 182 step,
186 source_language, 183 source_language,
187 target_language, 184 target_language,
188 error_type, 185 error_type,
189 original_profile->GetPrefs(),
190 triggered_from_menu); 186 triggered_from_menu);
191 } 187 }
192 188
193 TranslateDriver* TranslateTabHelper::GetTranslateDriver() { 189 TranslateDriver* TranslateTabHelper::GetTranslateDriver() {
194 return &translate_driver_; 190 return &translate_driver_;
195 } 191 }
196 192
197 PrefService* TranslateTabHelper::GetPrefs() { 193 PrefService* TranslateTabHelper::GetPrefs() {
198 DCHECK(web_contents()); 194 DCHECK(web_contents());
199 Profile* profile = 195 Profile* profile =
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 if (GetLanguageState().InTranslateNavigation()) 536 if (GetLanguageState().InTranslateNavigation())
541 return; 537 return;
542 } 538 }
543 539
544 TranslateBubbleFactory::Show( 540 TranslateBubbleFactory::Show(
545 browser->window(), web_contents(), step, error_type); 541 browser->window(), web_contents(), step, error_type);
546 #else 542 #else
547 NOTREACHED(); 543 NOTREACHED();
548 #endif 544 #endif
549 } 545 }
OLDNEW
« no previous file with comments | « chrome/browser/translate/translate_infobar_delegate.cc ('k') | chrome/browser/ui/cocoa/infobars/translate_infobar_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698