| 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 #ifndef UI_GFX_RENDER_TEXT_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_H_ |
| 6 #define UI_GFX_RENDER_TEXT_H_ | 6 #define UI_GFX_RENDER_TEXT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
| 13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "third_party/skia/include/core/SkColor.h" | 15 #include "third_party/skia/include/core/SkColor.h" |
| 16 #include "ui/base/range/range.h" | 16 #include "ui/base/range/range.h" |
| 17 #include "ui/gfx/font.h" | 17 #include "ui/gfx/font.h" |
| 18 #include "ui/gfx/point.h" | 18 #include "ui/gfx/point.h" |
| 19 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| 20 #include "ui/gfx/selection_model.h" | 20 #include "ui/gfx/selection_model.h" |
| 21 | 21 |
| 22 namespace gfx { | 22 namespace gfx { |
| 23 | 23 |
| 24 // Color settings for text, backgrounds and cursor. | |
| 25 // These are tentative, and should be derived from theme, system | |
| 26 // settings and current settings. | |
| 27 // TODO(oshima): Change this to match the standard chrome | |
| 28 // before dogfooding textfield views. | |
| 29 const SkColor kSelectedTextColor = SK_ColorWHITE; | |
| 30 const SkColor kFocusedSelectionColor = SkColorSetRGB(30, 144, 255); | |
| 31 const SkColor kUnfocusedSelectionColor = SK_ColorLTGRAY; | |
| 32 const SkColor kCursorColor = SK_ColorBLACK; | |
| 33 | |
| 34 class Canvas; | 24 class Canvas; |
| 35 class RenderTextTest; | 25 class RenderTextTest; |
| 36 | 26 |
| 37 // A visual style applicable to a range of text. | 27 // A visual style applicable to a range of text. |
| 38 struct UI_EXPORT StyleRange { | 28 struct UI_EXPORT StyleRange { |
| 39 StyleRange(); | 29 StyleRange(); |
| 40 | 30 |
| 41 Font font; | 31 Font font; |
| 42 SkColor foreground; | 32 SkColor foreground; |
| 43 bool strike; | 33 bool strike; |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 // The cached bounds and offset are invalidated by changes to the cursor, | 295 // The cached bounds and offset are invalidated by changes to the cursor, |
| 306 // selection, font, and other operations that adjust the visible text bounds. | 296 // selection, font, and other operations that adjust the visible text bounds. |
| 307 bool cached_bounds_and_offset_valid_; | 297 bool cached_bounds_and_offset_valid_; |
| 308 | 298 |
| 309 DISALLOW_COPY_AND_ASSIGN(RenderText); | 299 DISALLOW_COPY_AND_ASSIGN(RenderText); |
| 310 }; | 300 }; |
| 311 | 301 |
| 312 } // namespace gfx | 302 } // namespace gfx |
| 313 | 303 |
| 314 #endif // UI_GFX_RENDER_TEXT_H_ | 304 #endif // UI_GFX_RENDER_TEXT_H_ |
| OLD | NEW |