| 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 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 | 1361 |
| 1362 void BrowserPluginGuest::OnSetEditCommandsForNextKeyEvent( | 1362 void BrowserPluginGuest::OnSetEditCommandsForNextKeyEvent( |
| 1363 int instance_id, | 1363 int instance_id, |
| 1364 const std::vector<EditCommand>& edit_commands) { | 1364 const std::vector<EditCommand>& edit_commands) { |
| 1365 Send(new InputMsg_SetEditCommandsForNextKeyEvent(routing_id(), | 1365 Send(new InputMsg_SetEditCommandsForNextKeyEvent(routing_id(), |
| 1366 edit_commands)); | 1366 edit_commands)); |
| 1367 } | 1367 } |
| 1368 | 1368 |
| 1369 void BrowserPluginGuest::OnSetContentsOpaque(int instance_id, bool opaque) { | 1369 void BrowserPluginGuest::OnSetContentsOpaque(int instance_id, bool opaque) { |
| 1370 guest_opaque_ = opaque; | 1370 guest_opaque_ = opaque; |
| 1371 | 1371 Send(new ViewMsg_SetBackgroundOpaque(routing_id(), guest_opaque_)); |
| 1372 SkBitmap background; | |
| 1373 if (!guest_opaque_) { | |
| 1374 background.setConfig(SkBitmap::kARGB_8888_Config, 1, 1); | |
| 1375 unsigned int color = 0; | |
| 1376 background.setPixels(&color); | |
| 1377 } | |
| 1378 Send(new ViewMsg_SetBackground(routing_id(), background)); | |
| 1379 } | 1372 } |
| 1380 | 1373 |
| 1381 void BrowserPluginGuest::OnSetVisibility(int instance_id, bool visible) { | 1374 void BrowserPluginGuest::OnSetVisibility(int instance_id, bool visible) { |
| 1382 guest_visible_ = visible; | 1375 guest_visible_ = visible; |
| 1383 if (embedder_visible_ && guest_visible_) | 1376 if (embedder_visible_ && guest_visible_) |
| 1384 GetWebContents()->WasShown(); | 1377 GetWebContents()->WasShown(); |
| 1385 else | 1378 else |
| 1386 GetWebContents()->WasHidden(); | 1379 GetWebContents()->WasHidden(); |
| 1387 } | 1380 } |
| 1388 | 1381 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1547 const GURL& url) { | 1540 const GURL& url) { |
| 1548 if (!url.is_valid()) { | 1541 if (!url.is_valid()) { |
| 1549 callback.Run(false); | 1542 callback.Run(false); |
| 1550 return; | 1543 return; |
| 1551 } | 1544 } |
| 1552 | 1545 |
| 1553 delegate_->CanDownload(request_method, url, callback); | 1546 delegate_->CanDownload(request_method, url, callback); |
| 1554 } | 1547 } |
| 1555 | 1548 |
| 1556 } // namespace content | 1549 } // namespace content |
| OLD | NEW |