| OLD | NEW |
| 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/guest_view/web_view/web_view_guest.h" | 5 #include "chrome/browser/guest_view/web_view/web_view_guest.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 // Send the unhandled keyboard events back to the embedder to reprocess them. | 440 // Send the unhandled keyboard events back to the embedder to reprocess them. |
| 441 // TODO(fsamuel): This introduces the possibility of out-of-order keyboard | 441 // TODO(fsamuel): This introduces the possibility of out-of-order keyboard |
| 442 // events because the guest may be arbitrarily delayed when responding to | 442 // events because the guest may be arbitrarily delayed when responding to |
| 443 // keyboard events. In that time, the embedder may have received and processed | 443 // keyboard events. In that time, the embedder may have received and processed |
| 444 // additional key events. This needs to be fixed as soon as possible. | 444 // additional key events. This needs to be fixed as soon as possible. |
| 445 // See http://crbug.com/229882. | 445 // See http://crbug.com/229882. |
| 446 embedder_web_contents()->GetDelegate()->HandleKeyboardEvent( | 446 embedder_web_contents()->GetDelegate()->HandleKeyboardEvent( |
| 447 web_contents(), event); | 447 web_contents(), event); |
| 448 } | 448 } |
| 449 | 449 |
| 450 bool WebViewGuest::IsDragAndDropEnabled() { | |
| 451 return true; | |
| 452 } | |
| 453 | |
| 454 void WebViewGuest::LoadProgressChanged(content::WebContents* source, | 450 void WebViewGuest::LoadProgressChanged(content::WebContents* source, |
| 455 double progress) { | 451 double progress) { |
| 456 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 452 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 457 args->SetString(guestview::kUrl, guest_web_contents()->GetURL().spec()); | 453 args->SetString(guestview::kUrl, guest_web_contents()->GetURL().spec()); |
| 458 args->SetDouble(webview::kProgress, progress); | 454 args->SetDouble(webview::kProgress, progress); |
| 459 DispatchEvent( | 455 DispatchEvent( |
| 460 new GuestViewBase::Event(webview::kEventLoadProgress, args.Pass())); | 456 new GuestViewBase::Event(webview::kEventLoadProgress, args.Pass())); |
| 461 } | 457 } |
| 462 | 458 |
| 463 void WebViewGuest::LoadAbort(bool is_top_level, | 459 void WebViewGuest::LoadAbort(bool is_top_level, |
| (...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1409 bool allow, | 1405 bool allow, |
| 1410 const std::string& user_input) { | 1406 const std::string& user_input) { |
| 1411 WebViewGuest* guest = | 1407 WebViewGuest* guest = |
| 1412 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1408 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
| 1413 if (!guest) | 1409 if (!guest) |
| 1414 return; | 1410 return; |
| 1415 | 1411 |
| 1416 if (!allow) | 1412 if (!allow) |
| 1417 guest->Destroy(); | 1413 guest->Destroy(); |
| 1418 } | 1414 } |
| OLD | NEW |