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

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

Issue 525793002: Make WebContentsObserver::web_contents() public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments addressed Created 6 years, 3 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
« no previous file with comments | « chrome/browser/prerender/prerender_manager.cc ('k') | chrome/browser/ui/browser.cc » ('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/path_service.h" 10 #include "base/path_service.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 std::vector<std::string> accept_languages_list; 160 std::vector<std::string> accept_languages_list;
161 base::SplitString(accept_languages_str, ',', &accept_languages_list); 161 base::SplitString(accept_languages_str, ',', &accept_languages_list);
162 *target = 162 *target =
163 translate::TranslateManager::GetTargetLanguage(accept_languages_list); 163 translate::TranslateManager::GetTargetLanguage(accept_languages_list);
164 } 164 }
165 165
166 translate::TranslateManager* ChromeTranslateClient::GetTranslateManager() { 166 translate::TranslateManager* ChromeTranslateClient::GetTranslateManager() {
167 return translate_manager_.get(); 167 return translate_manager_.get();
168 } 168 }
169 169
170 content::WebContents* ChromeTranslateClient::GetWebContents() {
171 return web_contents();
172 }
173
174 void ChromeTranslateClient::ShowTranslateUI( 170 void ChromeTranslateClient::ShowTranslateUI(
175 translate::TranslateStep step, 171 translate::TranslateStep step,
176 const std::string source_language, 172 const std::string source_language,
177 const std::string target_language, 173 const std::string target_language,
178 translate::TranslateErrors::Type error_type, 174 translate::TranslateErrors::Type error_type,
179 bool triggered_from_menu) { 175 bool triggered_from_menu) {
180 DCHECK(web_contents()); 176 DCHECK(web_contents());
181 if (error_type != translate::TranslateErrors::NONE) 177 if (error_type != translate::TranslateErrors::NONE)
182 step = translate::TRANSLATE_STEP_TRANSLATE_ERROR; 178 step = translate::TRANSLATE_STEP_TRANSLATE_ERROR;
183 179
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 if (GetLanguageState().InTranslateNavigation()) 449 if (GetLanguageState().InTranslateNavigation())
454 return; 450 return;
455 } 451 }
456 452
457 TranslateBubbleFactory::Show( 453 TranslateBubbleFactory::Show(
458 browser->window(), web_contents(), step, error_type); 454 browser->window(), web_contents(), step, error_type);
459 #else 455 #else
460 NOTREACHED(); 456 NOTREACHED();
461 #endif 457 #endif
462 } 458 }
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_manager.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698