Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(333)

Side by Side Diff: chrome/browser/ui/webui/web_ui_util.h

Issue 10453101: Convert most of the rest of chrome to ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_WEBUI_WEB_UI_UTIL_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_WEB_UI_UTIL_H_
6 #define CHROME_BROWSER_UI_WEBUI_WEB_UI_UTIL_H_ 6 #define CHROME_BROWSER_UI_WEBUI_WEB_UI_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "webkit/glue/window_open_disposition.h" 12 #include "webkit/glue/window_open_disposition.h"
13 13
14 class SkBitmap; 14 namespace gfx {
15 class ImageSkia;
16 }
15 17
16 namespace web_ui_util { 18 namespace web_ui_util {
17 19
18 // Convenience routine to convert SkBitmap object to data url 20 // Convenience routine to convert ImageSkia object to data url
19 // so that it can be used in WebUI. 21 // so that it can be used in WebUI.
20 std::string GetImageDataUrl(const SkBitmap& bitmap); 22 std::string GetImageDataUrl(const gfx::ImageSkia& image);
21 23
22 // Convenience routine to get data url that corresponds to given 24 // Convenience routine to get data url that corresponds to given
23 // resource_id as an image. This function does not check if the 25 // resource_id as an image. This function does not check if the
24 // resource for the |resource_id| is an image, therefore it is the 26 // resource for the |resource_id| is an image, therefore it is the
25 // caller's responsibility to make sure the resource is indeed an 27 // caller's responsibility to make sure the resource is indeed an
26 // image. Returns empty string if a resource does not exist for given 28 // image. Returns empty string if a resource does not exist for given
27 // |resource_id|. 29 // |resource_id|.
28 std::string GetImageDataUrlFromResource(int resource_id); 30 std::string GetImageDataUrlFromResource(int resource_id);
29 31
30 // Extracts a disposition from click event arguments. |args| should contain 32 // Extracts a disposition from click event arguments. |args| should contain
31 // an integer button and booleans alt key, ctrl key, meta key, and shift key 33 // an integer button and booleans alt key, ctrl key, meta key, and shift key
32 // (in that order), starting at |start_index|. 34 // (in that order), starting at |start_index|.
33 WindowOpenDisposition GetDispositionFromClick(const ListValue* args, 35 WindowOpenDisposition GetDispositionFromClick(const ListValue* args,
34 int start_index); 36 int start_index);
35 37
36 } // namespace web_ui_util 38 } // namespace web_ui_util
37 39
38 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_UTIL_H_ 40 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/task_manager/task_manager_handler.cc ('k') | chrome/browser/ui/webui/web_ui_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698