| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 1365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 | 1376 |
| 1377 void BrowserPluginGuest::OnSetEditCommandsForNextKeyEvent( | 1377 void BrowserPluginGuest::OnSetEditCommandsForNextKeyEvent( |
| 1378 int instance_id, | 1378 int instance_id, |
| 1379 const std::vector<EditCommand>& edit_commands) { | 1379 const std::vector<EditCommand>& edit_commands) { |
| 1380 Send(new InputMsg_SetEditCommandsForNextKeyEvent(routing_id(), | 1380 Send(new InputMsg_SetEditCommandsForNextKeyEvent(routing_id(), |
| 1381 edit_commands)); | 1381 edit_commands)); |
| 1382 } | 1382 } |
| 1383 | 1383 |
| 1384 void BrowserPluginGuest::OnSetContentsOpaque(int instance_id, bool opaque) { | 1384 void BrowserPluginGuest::OnSetContentsOpaque(int instance_id, bool opaque) { |
| 1385 guest_opaque_ = opaque; | 1385 guest_opaque_ = opaque; |
| 1386 | 1386 Send(new ViewMsg_SetBackgroundOpaque(routing_id(), guest_opaque_)); |
| 1387 SkBitmap background; | |
| 1388 if (!guest_opaque_) { | |
| 1389 background.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); | |
| 1390 unsigned int color = 0; | |
| 1391 background.setPixels(&color); | |
| 1392 } | |
| 1393 Send(new ViewMsg_SetBackground(routing_id(), background)); | |
| 1394 } | 1387 } |
| 1395 | 1388 |
| 1396 void BrowserPluginGuest::OnSetVisibility(int instance_id, bool visible) { | 1389 void BrowserPluginGuest::OnSetVisibility(int instance_id, bool visible) { |
| 1397 guest_visible_ = visible; | 1390 guest_visible_ = visible; |
| 1398 if (embedder_visible_ && guest_visible_) | 1391 if (embedder_visible_ && guest_visible_) |
| 1399 GetWebContents()->WasShown(); | 1392 GetWebContents()->WasShown(); |
| 1400 else | 1393 else |
| 1401 GetWebContents()->WasHidden(); | 1394 GetWebContents()->WasHidden(); |
| 1402 } | 1395 } |
| 1403 | 1396 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1562 const GURL& url) { | 1555 const GURL& url) { |
| 1563 if (!url.is_valid()) { | 1556 if (!url.is_valid()) { |
| 1564 callback.Run(false); | 1557 callback.Run(false); |
| 1565 return; | 1558 return; |
| 1566 } | 1559 } |
| 1567 | 1560 |
| 1568 delegate_->CanDownload(request_method, url, callback); | 1561 delegate_->CanDownload(request_method, url, callback); |
| 1569 } | 1562 } |
| 1570 | 1563 |
| 1571 } // namespace content | 1564 } // namespace content |
| OLD | NEW |