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

Unified Diff: views/controls/textfield/text_style.h

Issue 7265011: RenderText API Outline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix permissions, export RenderText and StyleRange via UI_API. Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: views/controls/textfield/text_style.h
diff --git a/views/controls/textfield/text_style.h b/views/controls/textfield/text_style.h
deleted file mode 100644
index e489aee115d2a7fd53197113291aec96ac9df823..0000000000000000000000000000000000000000
--- a/views/controls/textfield/text_style.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef VIEWS_CONTROLS_TEXTFIELD_TEXT_STYLE_H_
-#define VIEWS_CONTROLS_TEXTFIELD_TEXT_STYLE_H_
-#pragma once
-
-#include "base/basictypes.h"
-#include "base/gtest_prod_util.h"
-#include "base/string16.h"
-#include "third_party/skia/include/core/SkColor.h"
-
-namespace gfx {
-class Canvas;
-class Font;
-}
-
-namespace views {
-
-// A class that specifies text style for TextfieldViews.
-// TODO(suzhe|oshima): support underline color and thick style.
-class TextStyle {
- public:
- // Foreground color for the text.
- void set_foreground(SkColor color) { foreground_ = color; }
-
- // Draws diagnoal strike acrosss the text.
- void set_strike(bool strike) { strike_ = strike; }
-
- // Adds underline to the text.
- void set_underline(bool underline) { underline_ = underline; }
-
- private:
- friend class NativeTextfieldViews;
- friend class TextfieldViewsModel;
-
- FRIEND_TEST_ALL_PREFIXES(TextfieldViewsModelTest, TextStyleTest);
- FRIEND_TEST_ALL_PREFIXES(TextfieldViewsModelTest, UndoRedo_CompositionText);
- FRIEND_TEST_ALL_PREFIXES(TextfieldViewsModelTest, CompositionTextTest);
-
- TextStyle();
- virtual ~TextStyle();
-
- SkColor foreground() const { return foreground_; }
- bool underline() const { return underline_; }
-
- // Draw string to the canvas within the region given
- // by |x|,|y|,|width|,|height|.
- void DrawString(gfx::Canvas* canvas,
- string16& text,
- gfx::Font& base_font,
- bool read_only,
- int x, int y, int width, int height) const;
-
- SkColor foreground_;
- bool strike_;
- bool underline_;
-
- DISALLOW_COPY_AND_ASSIGN(TextStyle);
-};
-
-} // namespace views
-
-#endif // VIEWS_CONTROLS_TEXTFIELD_TEXT_STYLE_H_

Powered by Google App Engine
This is Rietveld 408576698