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

Side by Side Diff: components/translate/ios/browser/ios_translate_driver.mm

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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
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 "components/translate/ios/browser/ios_translate_driver.h" 5 #include "components/translate/ios/browser/ios_translate_driver.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/strings/sys_string_conversions.h" 9 #include "base/strings/sys_string_conversions.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 158
159 const GURL& IOSTranslateDriver::GetVisibleURL() { 159 const GURL& IOSTranslateDriver::GetVisibleURL() {
160 return web_state()->GetVisibleURL(); 160 return web_state()->GetVisibleURL();
161 } 161 }
162 162
163 bool IOSTranslateDriver::HasCurrentPage() { 163 bool IOSTranslateDriver::HasCurrentPage() {
164 return (navigation_manager_->GetVisibleItem() != nullptr); 164 return (navigation_manager_->GetVisibleItem() != nullptr);
165 } 165 }
166 166
167 void IOSTranslateDriver::OpenUrlInNewTab(const GURL& url) { 167 void IOSTranslateDriver::OpenUrlInNewTab(const GURL& url) {
168 web::WebState::OpenURLParams params(url, web::Referrer(), NEW_FOREGROUND_TAB, 168 web::WebState::OpenURLParams params(url, web::Referrer(),
169 WindowOpenDisposition::NEW_FOREGROUND_TAB,
169 ui::PAGE_TRANSITION_LINK, false); 170 ui::PAGE_TRANSITION_LINK, false);
170 web_state()->OpenURL(params); 171 web_state()->OpenURL(params);
171 } 172 }
172 173
173 void IOSTranslateDriver::TranslationDidSucceed( 174 void IOSTranslateDriver::TranslationDidSucceed(
174 const std::string& source_lang, 175 const std::string& source_lang,
175 const std::string& target_lang, 176 const std::string& target_lang,
176 int page_seq_no, 177 int page_seq_no,
177 const std::string& original_page_language, 178 const std::string& original_page_language,
178 double translation_time) { 179 double translation_time) {
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 translate_manager_->PageTranslated(source_language_, target_language_, 255 translate_manager_->PageTranslated(source_language_, target_language_,
255 TranslateErrors::TRANSLATION_ERROR); 256 TranslateErrors::TRANSLATION_ERROR);
256 } 257 }
257 258
258 TranslationDidSucceed(source_language_, target_language_, 259 TranslationDidSucceed(source_language_, target_language_,
259 pending_page_seq_no_, original_language, 260 pending_page_seq_no_, original_language,
260 translation_time); 261 translation_time);
261 } 262 }
262 263
263 } // namespace translate 264 } // namespace translate
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698