OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer_host/render_view_host.h" | 5 #include "chrome/browser/renderer_host/render_view_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 } | 2007 } |
2008 | 2008 |
2009 void RenderViewHost::PerformCustomContextMenuAction(unsigned action) { | 2009 void RenderViewHost::PerformCustomContextMenuAction(unsigned action) { |
2010 Send(new ViewMsg_CustomContextMenuAction(routing_id(), action)); | 2010 Send(new ViewMsg_CustomContextMenuAction(routing_id(), action)); |
2011 } | 2011 } |
2012 | 2012 |
2013 void RenderViewHost::TranslatePage(int page_id, | 2013 void RenderViewHost::TranslatePage(int page_id, |
2014 const std::string& translate_script, | 2014 const std::string& translate_script, |
2015 const std::string& source_lang, | 2015 const std::string& source_lang, |
2016 const std::string& target_lang) { | 2016 const std::string& target_lang) { |
| 2017 // Ideally we'd have a better way to uniquely identify form control elements, |
| 2018 // but we don't have that yet. So before start translation, we clear the |
| 2019 // current form and re-parse it in AutoFillManager first to get the new |
| 2020 // labels. |
| 2021 RenderViewHostDelegate::AutoFill* autofill_delegate = |
| 2022 delegate_->GetAutoFillDelegate(); |
| 2023 if (autofill_delegate) |
| 2024 autofill_delegate->Reset(); |
| 2025 |
2017 Send(new ViewMsg_TranslatePage(routing_id(), page_id, translate_script, | 2026 Send(new ViewMsg_TranslatePage(routing_id(), page_id, translate_script, |
2018 source_lang, target_lang)); | 2027 source_lang, target_lang)); |
2019 } | 2028 } |
2020 | 2029 |
2021 void RenderViewHost::RevertTranslation(int page_id) { | 2030 void RenderViewHost::RevertTranslation(int page_id) { |
2022 Send(new ViewMsg_RevertTranslation(routing_id(), page_id)); | 2031 Send(new ViewMsg_RevertTranslation(routing_id(), page_id)); |
2023 } | 2032 } |
2024 | 2033 |
2025 void RenderViewHost::SendContentSettings(const GURL& url, | 2034 void RenderViewHost::SendContentSettings(const GURL& url, |
2026 const ContentSettings& settings) { | 2035 const ContentSettings& settings) { |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2251 if (printer_query.get()) { | 2260 if (printer_query.get()) { |
2252 BrowserThread::PostTask( | 2261 BrowserThread::PostTask( |
2253 BrowserThread::IO, FROM_HERE, | 2262 BrowserThread::IO, FROM_HERE, |
2254 NewRunnableMethod(printer_query.get(), | 2263 NewRunnableMethod(printer_query.get(), |
2255 &printing::PrinterQuery::StopWorker)); | 2264 &printing::PrinterQuery::StopWorker)); |
2256 } | 2265 } |
2257 | 2266 |
2258 // Send the printingDone msg for now. | 2267 // Send the printingDone msg for now. |
2259 Send(new ViewMsg_PrintingDone(routing_id(), -1, true)); | 2268 Send(new ViewMsg_PrintingDone(routing_id(), -1, true)); |
2260 } | 2269 } |
OLD | NEW |