Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1505 if (edit_commands_.empty()) | 1505 if (edit_commands_.empty()) |
| 1506 return false; | 1506 return false; |
| 1507 | 1507 |
| 1508 WebFrame* frame = webview()->GetFocusedFrame(); | 1508 WebFrame* frame = webview()->GetFocusedFrame(); |
| 1509 if (!frame) | 1509 if (!frame) |
| 1510 return false; | 1510 return false; |
| 1511 | 1511 |
| 1512 EditCommands::iterator it = edit_commands_.begin(); | 1512 EditCommands::iterator it = edit_commands_.begin(); |
| 1513 EditCommands::iterator end = edit_commands_.end(); | 1513 EditCommands::iterator end = edit_commands_.end(); |
| 1514 | 1514 |
| 1515 bool did_execute_command = false; | |
| 1515 for (; it != end; ++it) { | 1516 for (; it != end; ++it) { |
| 1517 // In gtk, it's possible to bind multiple edit commands to one key (but it's | |
| 1518 // the exception). Once one edit command is not executed, it seems safest to | |
| 1519 // not execute the rest. | |
|
jeremy
2009/09/29 18:12:56
Are we sure this isn't possible on OSX as well?
Ac
Nico
2009/09/30 03:51:35
Oh, this wasn't supposed to mean "only in gtk" but
| |
| 1516 if (!frame->executeCommand(WebString::fromUTF8(it->name), | 1520 if (!frame->executeCommand(WebString::fromUTF8(it->name), |
| 1517 WebString::fromUTF8(it->value))) | 1521 WebString::fromUTF8(it->value))) |
| 1518 break; | 1522 break; |
| 1523 did_execute_command = true; | |
| 1519 } | 1524 } |
| 1520 | 1525 |
| 1521 return true; | 1526 return did_execute_command; |
| 1522 } | 1527 } |
| 1523 | 1528 |
| 1524 void RenderView::spellCheck( | 1529 void RenderView::spellCheck( |
| 1525 const WebString& text, int& misspelled_offset, int& misspelled_length) { | 1530 const WebString& text, int& misspelled_offset, int& misspelled_length) { |
| 1526 EnsureDocumentTag(); | 1531 EnsureDocumentTag(); |
| 1527 Send(new ViewHostMsg_SpellCheck( | 1532 Send(new ViewHostMsg_SpellCheck( |
| 1528 routing_id_, UTF16ToWideHack(text), document_tag_, | 1533 routing_id_, UTF16ToWideHack(text), document_tag_, |
| 1529 &misspelled_offset, &misspelled_length)); | 1534 &misspelled_offset, &misspelled_length)); |
| 1530 } | 1535 } |
| 1531 | 1536 |
| (...skipping 2039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3571 modal_dialog_event_->Signal(); | 3576 modal_dialog_event_->Signal(); |
| 3572 | 3577 |
| 3573 message->EnableMessagePumping(); // Runs a nested message loop. | 3578 message->EnableMessagePumping(); // Runs a nested message loop. |
| 3574 bool rv = Send(message); | 3579 bool rv = Send(message); |
| 3575 | 3580 |
| 3576 if (--modal_dialog_count_ == 0) | 3581 if (--modal_dialog_count_ == 0) |
| 3577 modal_dialog_event_->Reset(); | 3582 modal_dialog_event_->Reset(); |
| 3578 | 3583 |
| 3579 return rv; | 3584 return rv; |
| 3580 } | 3585 } |
| OLD | NEW |