| 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/ui/webui/web_ui_util.h" | 5 #include "chrome/browser/ui/webui/web_ui_util.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/logging.h" |
| 10 #include "base/values.h" | 11 #include "base/values.h" |
| 11 #include "content/browser/disposition_utils.h" | 12 #include "chrome/browser/disposition_utils.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 13 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/gfx/codec/png_codec.h" | 14 #include "ui/gfx/codec/png_codec.h" |
| 14 | 15 |
| 15 namespace web_ui_util { | 16 namespace web_ui_util { |
| 16 | 17 |
| 17 std::string GetImageDataUrl(const SkBitmap& bitmap) { | 18 std::string GetImageDataUrl(const SkBitmap& bitmap) { |
| 18 std::vector<unsigned char> output; | 19 std::vector<unsigned char> output; |
| 19 gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, &output); | 20 gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, &output); |
| 20 std::string str_url; | 21 std::string str_url; |
| 21 str_url.insert(str_url.end(), output.begin(), output.end()); | 22 str_url.insert(str_url.end(), output.begin(), output.end()); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 CHECK(args->GetBoolean(start_index++, &alt_key)); | 54 CHECK(args->GetBoolean(start_index++, &alt_key)); |
| 54 CHECK(args->GetBoolean(start_index++, &ctrl_key)); | 55 CHECK(args->GetBoolean(start_index++, &ctrl_key)); |
| 55 CHECK(args->GetBoolean(start_index++, &meta_key)); | 56 CHECK(args->GetBoolean(start_index++, &meta_key)); |
| 56 CHECK(args->GetBoolean(start_index++, &shift_key)); | 57 CHECK(args->GetBoolean(start_index++, &shift_key)); |
| 57 return disposition_utils::DispositionFromClick(button == 1.0, alt_key, | 58 return disposition_utils::DispositionFromClick(button == 1.0, alt_key, |
| 58 ctrl_key, meta_key, shift_key); | 59 ctrl_key, meta_key, shift_key); |
| 59 | 60 |
| 60 } | 61 } |
| 61 | 62 |
| 62 } // namespace web_ui_util | 63 } // namespace web_ui_util |
| OLD | NEW |