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

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

Issue 11896047: Move the methods in disposition_utils.h and event_disposition.h to ui\base\window_open_disposition.… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix regex in ui.gyp Created 7 years, 11 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
« no previous file with comments | « chrome/browser/ui/webui/generic_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
11 #include "base/i18n/rtl.h" 11 #include "base/i18n/rtl.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/ref_counted_memory.h" 13 #include "base/memory/ref_counted_memory.h"
14 #include "chrome/browser/disposition_utils.h"
15 #include "googleurl/src/gurl.h" 14 #include "googleurl/src/gurl.h"
16 #include "net/base/escape.h" 15 #include "net/base/escape.h"
17 #include "grit/platform_locale_settings.h" 16 #include "grit/platform_locale_settings.h"
17 #include "ui/base/window_open_disposition.h"
18 #include "ui/base/resource/resource_bundle.h" 18 #include "ui/base/resource/resource_bundle.h"
19 #include "ui/gfx/codec/png_codec.h" 19 #include "ui/gfx/codec/png_codec.h"
20 #include "ui/gfx/image/image_skia.h" 20 #include "ui/gfx/image/image_skia.h"
21 #include "ui/base/l10n/l10n_util.h" 21 #include "ui/base/l10n/l10n_util.h"
22 22
23 #if defined (TOOLKIT_GTK) 23 #if defined (TOOLKIT_GTK)
24 #include "ui/base/resource/resource_bundle.h" 24 #include "ui/base/resource/resource_bundle.h"
25 #include "ui/gfx/font.h" 25 #include "ui/gfx/font.h"
26 #endif 26 #endif
27 27
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 bool alt_key = false; 81 bool alt_key = false;
82 bool ctrl_key = false; 82 bool ctrl_key = false;
83 bool meta_key = false; 83 bool meta_key = false;
84 bool shift_key = false; 84 bool shift_key = false;
85 85
86 CHECK(args->GetDouble(start_index++, &button)); 86 CHECK(args->GetDouble(start_index++, &button));
87 CHECK(args->GetBoolean(start_index++, &alt_key)); 87 CHECK(args->GetBoolean(start_index++, &alt_key));
88 CHECK(args->GetBoolean(start_index++, &ctrl_key)); 88 CHECK(args->GetBoolean(start_index++, &ctrl_key));
89 CHECK(args->GetBoolean(start_index++, &meta_key)); 89 CHECK(args->GetBoolean(start_index++, &meta_key));
90 CHECK(args->GetBoolean(start_index++, &shift_key)); 90 CHECK(args->GetBoolean(start_index++, &shift_key));
91 return disposition_utils::DispositionFromClick(button == 1.0, alt_key, 91 return ui::DispositionFromClick(
92 ctrl_key, meta_key, shift_key); 92 button == 1.0, alt_key, ctrl_key, meta_key, shift_key);
93
94 } 93 }
95 94
96 bool ParseScaleFactor(const base::StringPiece& identifier, 95 bool ParseScaleFactor(const base::StringPiece& identifier,
97 ui::ScaleFactor* scale_factor) { 96 ui::ScaleFactor* scale_factor) {
98 *scale_factor = ui::SCALE_FACTOR_100P; 97 *scale_factor = ui::SCALE_FACTOR_100P;
99 for (size_t i = 0; i < arraysize(kScaleFactorMap); i++) { 98 for (size_t i = 0; i < arraysize(kScaleFactorMap); i++) {
100 if (identifier == kScaleFactorMap[i].name) { 99 if (identifier == kScaleFactorMap[i].name) {
101 *scale_factor = kScaleFactorMap[i].scale_factor; 100 *scale_factor = kScaleFactorMap[i].scale_factor;
102 return true; 101 return true;
103 } 102 }
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 #endif 152 #endif
154 153
155 localized_strings->SetString("fontfamily", font_family); 154 localized_strings->SetString("fontfamily", font_family);
156 localized_strings->SetString("fontsize", 155 localized_strings->SetString("fontsize",
157 l10n_util::GetStringUTF8(web_font_size_id)); 156 l10n_util::GetStringUTF8(web_font_size_id));
158 localized_strings->SetString("textdirection", 157 localized_strings->SetString("textdirection",
159 base::i18n::IsRTL() ? "rtl" : "ltr"); 158 base::i18n::IsRTL() ? "rtl" : "ltr");
160 } 159 }
161 160
162 } // namespace web_ui_util 161 } // namespace web_ui_util
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/generic_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698