OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/clipboard.h" | 5 #include "base/clipboard.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <utility> | 11 #include <utility> |
12 | 12 |
| 13 #include "base/file_path.h" |
| 14 #include "base/gfx/size.h" |
13 #include "base/scoped_ptr.h" | 15 #include "base/scoped_ptr.h" |
14 #include "base/linux_util.h" | 16 #include "base/linux_util.h" |
15 #include "base/string_util.h" | 17 #include "base/string_util.h" |
16 | 18 |
17 namespace { | 19 namespace { |
18 | 20 |
19 const char kMimeBmp[] = "image/bmp"; | 21 const char kMimeBmp[] = "image/bmp"; |
20 const char kMimeHtml[] = "text/html"; | 22 const char kMimeHtml[] = "text/html"; |
21 const char kMimeText[] = "text/plain"; | 23 const char kMimeText[] = "text/plain"; |
22 const char kMimeWebkitSmartPaste[] = "chromium-internal/webkit-paste"; | 24 const char kMimeWebkitSmartPaste[] = "chromium-internal/webkit-paste"; |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 321 |
320 if (iter != clipboard_data_->end()) { | 322 if (iter != clipboard_data_->end()) { |
321 if (strcmp(kMimeBmp, key) == 0) | 323 if (strcmp(kMimeBmp, key) == 0) |
322 g_object_unref(reinterpret_cast<GdkPixbuf*>(iter->second.first)); | 324 g_object_unref(reinterpret_cast<GdkPixbuf*>(iter->second.first)); |
323 else | 325 else |
324 delete[] iter->second.first; | 326 delete[] iter->second.first; |
325 } | 327 } |
326 | 328 |
327 (*clipboard_data_)[key] = std::make_pair(data, data_len); | 329 (*clipboard_data_)[key] = std::make_pair(data, data_len); |
328 } | 330 } |
OLD | NEW |