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

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

Issue 10837270: webui: Change slightly how the scale-factor gets parsed from a URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: indent Created 8 years, 4 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) 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 #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 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
(...skipping 20 matching lines...) Expand all
31 // image. Returns empty string if a resource does not exist for given 31 // image. Returns empty string if a resource does not exist for given
32 // |resource_id|. 32 // |resource_id|.
33 std::string GetImageDataUrlFromResource(int resource_id); 33 std::string GetImageDataUrlFromResource(int resource_id);
34 34
35 // Extracts a disposition from click event arguments. |args| should contain 35 // Extracts a disposition from click event arguments. |args| should contain
36 // an integer button and booleans alt key, ctrl key, meta key, and shift key 36 // an integer button and booleans alt key, ctrl key, meta key, and shift key
37 // (in that order), starting at |start_index|. 37 // (in that order), starting at |start_index|.
38 WindowOpenDisposition GetDispositionFromClick(const ListValue* args, 38 WindowOpenDisposition GetDispositionFromClick(const ListValue* args,
39 int start_index); 39 int start_index);
40 40
41 // Given a scale factor such as "1x" or "2x" returns the ScaleFactor enum 41 // Given a scale factor such as "1x" or "2x", sets |scale_factor| to the
42 // value for this scale factor. 42 // ScaleFactor enum value for this scale factor. If the scale factor could not
43 ui::ScaleFactor ParseScaleFactor(const base::StringPiece& identifier); 43 // be determined correctly from the string, then |scale_factor| is set to
44 // SCALE_FACTOR_NONE, and false is returned.
45 bool ParseScaleFactor(const base::StringPiece& identifier,
46 ui::ScaleFactor* scale_factor);
44 47
45 // Parses a URL containing some path @{scale}x. If it does not contain a scale 48 // Parses a URL containing some path @{scale}x. If it does not contain a scale
46 // factor then the default scale factor is returned. 49 // factor then the default scale factor is returned.
47 void ParsePathAndScale(const GURL& url, 50 void ParsePathAndScale(const GURL& url,
48 std::string* path, 51 std::string* path,
49 ui::ScaleFactor* scale_factor); 52 ui::ScaleFactor* scale_factor);
50 53
51 } // namespace web_ui_util 54 } // namespace web_ui_util
52 55
53 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_UTIL_H_ 56 #endif // CHROME_BROWSER_UI_WEBUI_WEB_UI_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options2/chromeos/user_image_source.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