| 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 "extensions/browser/guest_view/web_view/web_view_guest.h" | 5 #include "extensions/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 "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 } | 344 } |
| 345 | 345 |
| 346 bool WebViewGuest::IsDragAndDropEnabled() const { | 346 bool WebViewGuest::IsDragAndDropEnabled() const { |
| 347 return true; | 347 return true; |
| 348 } | 348 } |
| 349 | 349 |
| 350 void WebViewGuest::WillDestroy() { | 350 void WebViewGuest::WillDestroy() { |
| 351 if (!attached() && GetOpener()) | 351 if (!attached() && GetOpener()) |
| 352 GetOpener()->pending_new_windows_.erase(this); | 352 GetOpener()->pending_new_windows_.erase(this); |
| 353 DestroyUnattachedWindows(); | 353 DestroyUnattachedWindows(); |
| 354 |
| 355 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 356 DispatchEventToEmbedder( |
| 357 new GuestViewBase::Event(webview::kEventPluginDestroyed, args.Pass())); |
| 354 } | 358 } |
| 355 | 359 |
| 356 bool WebViewGuest::AddMessageToConsole(WebContents* source, | 360 bool WebViewGuest::AddMessageToConsole(WebContents* source, |
| 357 int32 level, | 361 int32 level, |
| 358 const base::string16& message, | 362 const base::string16& message, |
| 359 int32 line_no, | 363 int32 line_no, |
| 360 const base::string16& source_id) { | 364 const base::string16& source_id) { |
| 361 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); | 365 scoped_ptr<base::DictionaryValue> args(new base::DictionaryValue()); |
| 362 // Log levels are from base/logging.h: LogSeverity. | 366 // Log levels are from base/logging.h: LogSeverity. |
| 363 args->SetInteger(webview::kLevel, level); | 367 args->SetInteger(webview::kLevel, level); |
| (...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 WebViewGuest* guest = | 1100 WebViewGuest* guest = |
| 1097 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); | 1101 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); |
| 1098 if (!guest) | 1102 if (!guest) |
| 1099 return; | 1103 return; |
| 1100 | 1104 |
| 1101 if (!allow) | 1105 if (!allow) |
| 1102 guest->Destroy(); | 1106 guest->Destroy(); |
| 1103 } | 1107 } |
| 1104 | 1108 |
| 1105 } // namespace extensions | 1109 } // namespace extensions |
| OLD | NEW |