OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_tabs_module.h" | 5 #include "chrome/browser/extensions/extension_tabs_module.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/base64.h" | 10 #include "base/base64.h" |
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 BackingStore* backing_store) { | 1198 BackingStore* backing_store) { |
1199 | 1199 |
1200 skia::PlatformCanvas temp_canvas; | 1200 skia::PlatformCanvas temp_canvas; |
1201 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), | 1201 if (!backing_store->CopyFromBackingStore(gfx::Rect(backing_store->size()), |
1202 &temp_canvas)) { | 1202 &temp_canvas)) { |
1203 return false; | 1203 return false; |
1204 } | 1204 } |
1205 VLOG(1) << "captureVisibleTab() got image from backing store."; | 1205 VLOG(1) << "captureVisibleTab() got image from backing store."; |
1206 | 1206 |
1207 SendResultFromBitmap( | 1207 SendResultFromBitmap( |
1208 temp_canvas.getTopPlatformDevice().accessBitmap(false)); | 1208 skia::GetTopDevice(temp_canvas)->accessBitmap(false)); |
1209 return true; | 1209 return true; |
1210 } | 1210 } |
1211 | 1211 |
1212 // If a backing store was not available in CaptureVisibleTabFunction::RunImpl, | 1212 // If a backing store was not available in CaptureVisibleTabFunction::RunImpl, |
1213 // than the renderer was asked for a snapshot. Listen for a notification | 1213 // than the renderer was asked for a snapshot. Listen for a notification |
1214 // that the snapshot is available. | 1214 // that the snapshot is available. |
1215 void CaptureVisibleTabFunction::Observe(NotificationType type, | 1215 void CaptureVisibleTabFunction::Observe(NotificationType type, |
1216 const NotificationSource& source, | 1216 const NotificationSource& source, |
1217 const NotificationDetails& details) { | 1217 const NotificationDetails& details) { |
1218 DCHECK(type == NotificationType::TAB_SNAPSHOT_TAKEN); | 1218 DCHECK(type == NotificationType::TAB_SNAPSHOT_TAKEN); |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1347 // called for every API call the extension made. | 1347 // called for every API call the extension made. |
1348 GotLanguage(language); | 1348 GotLanguage(language); |
1349 } | 1349 } |
1350 | 1350 |
1351 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { | 1351 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { |
1352 result_.reset(Value::CreateStringValue(language.c_str())); | 1352 result_.reset(Value::CreateStringValue(language.c_str())); |
1353 SendResponse(true); | 1353 SendResponse(true); |
1354 | 1354 |
1355 Release(); // Balanced in Run() | 1355 Release(); // Balanced in Run() |
1356 } | 1356 } |
OLD | NEW |