| OLD | NEW | 
|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test/mock_webclipboard_impl.h" | 5 #include "content/test/mock_webclipboard_impl.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 | 8 | 
| 9 #include "base/logging.h" | 9 #include "base/logging.h" | 
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
| 38     case FormatHTML: | 38     case FormatHTML: | 
| 39       return !m_htmlText.is_null(); | 39       return !m_htmlText.is_null(); | 
| 40 | 40 | 
| 41     case FormatSmartPaste: | 41     case FormatSmartPaste: | 
| 42       return m_writeSmartPaste; | 42       return m_writeSmartPaste; | 
| 43 | 43 | 
| 44     default: | 44     default: | 
| 45       NOTREACHED(); | 45       NOTREACHED(); | 
| 46       return false; | 46       return false; | 
| 47   } | 47   } | 
| 48 |  | 
| 49   switch (buffer) { |  | 
| 50     case BufferStandard: |  | 
| 51       break; |  | 
| 52     case BufferSelection: |  | 
| 53 #if defined(OS_POSIX) && !defined(OS_MACOSX) |  | 
| 54       break; |  | 
| 55 #endif |  | 
| 56     default: |  | 
| 57       NOTREACHED(); |  | 
| 58       return false; |  | 
| 59   } |  | 
| 60 |  | 
| 61   return true; |  | 
| 62 } | 48 } | 
| 63 | 49 | 
| 64 WebVector<WebString> MockWebClipboardImpl::readAvailableTypes( | 50 WebVector<WebString> MockWebClipboardImpl::readAvailableTypes( | 
| 65     Buffer buffer, | 51     Buffer buffer, | 
| 66     bool* containsFilenames) { | 52     bool* containsFilenames) { | 
| 67   *containsFilenames = false; | 53   *containsFilenames = false; | 
| 68   std::vector<WebString> results; | 54   std::vector<WebString> results; | 
| 69   if (!m_plainText.string().empty()) { | 55   if (!m_plainText.string().empty()) { | 
| 70     results.push_back(WebString("text/plain")); | 56     results.push_back(WebString("text/plain")); | 
| 71   } | 57   } | 
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 200 | 186 | 
| 201 void MockWebClipboardImpl::clear() { | 187 void MockWebClipboardImpl::clear() { | 
| 202   m_plainText = base::NullableString16(); | 188   m_plainText = base::NullableString16(); | 
| 203   m_htmlText = base::NullableString16(); | 189   m_htmlText = base::NullableString16(); | 
| 204   m_image.reset(); | 190   m_image.reset(); | 
| 205   m_customData.clear(); | 191   m_customData.clear(); | 
| 206   m_writeSmartPaste = false; | 192   m_writeSmartPaste = false; | 
| 207 } | 193 } | 
| 208 | 194 | 
| 209 }  // namespace content | 195 }  // namespace content | 
| OLD | NEW | 
|---|