| 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 "chrome/browser/ui/views/extensions/browser_action_drag_data.h" | 5 #include "chrome/browser/ui/views/extensions/browser_action_drag_data.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "base/pickle.h" | 10 #include "base/pickle.h" |
| 9 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 11 #include "ui/base/clipboard/clipboard.h" | 13 #include "ui/base/clipboard/clipboard.h" |
| 12 | 14 |
| 13 namespace { | 15 namespace { |
| 14 | 16 |
| 15 // The MIME type for the clipboard format for BrowserActionDragData. | 17 // The MIME type for the clipboard format for BrowserActionDragData. |
| 16 const char kClipboardFormatString[] = "chromium/x-browser-actions"; | 18 const char kClipboardFormatString[] = "chromium/x-browser-actions"; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 base::PickleIterator data_iterator(*pickle); | 94 base::PickleIterator data_iterator(*pickle); |
| 93 | 95 |
| 94 const char* tmp; | 96 const char* tmp; |
| 95 if (!data_iterator.ReadBytes(&tmp, sizeof(profile_))) | 97 if (!data_iterator.ReadBytes(&tmp, sizeof(profile_))) |
| 96 return false; | 98 return false; |
| 97 memcpy(&profile_, tmp, sizeof(profile_)); | 99 memcpy(&profile_, tmp, sizeof(profile_)); |
| 98 | 100 |
| 99 if (!data_iterator.ReadString(&id_)) | 101 if (!data_iterator.ReadString(&id_)) |
| 100 return false; | 102 return false; |
| 101 | 103 |
| 102 uint64 index; | 104 uint64_t index; |
| 103 if (!data_iterator.ReadUInt64(&index)) | 105 if (!data_iterator.ReadUInt64(&index)) |
| 104 return false; | 106 return false; |
| 105 index_ = static_cast<size_t>(index); | 107 index_ = static_cast<size_t>(index); |
| 106 | 108 |
| 107 return true; | 109 return true; |
| 108 } | 110 } |
| OLD | NEW |