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

Unified Diff: chrome/views/text_field.cc

Issue 18728: Create a dialog box for the about:network view and kill the tab type.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« chrome/browser/views/about_network_dialog.cc ('K') | « chrome/views/text_field.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/text_field.cc
===================================================================
--- chrome/views/text_field.cc (revision 8567)
+++ chrome/views/text_field.cc (working copy)
@@ -47,6 +47,7 @@
std::wstring GetText() const;
void SetText(const std::wstring& text);
+ void AppendText(const std::wstring& text);
std::wstring GetSelectedText() const;
@@ -315,6 +316,13 @@
SetWindowText(text_to_set.c_str());
}
+void TextField::Edit::AppendText(const std::wstring& text) {
+ int text_length = GetWindowTextLength();
+ ::SendMessage(m_hWnd, TBM_SETSEL, true, MAKELPARAM(text_length, text_length));
+ ::SendMessage(m_hWnd, EM_REPLACESEL, false,
+ reinterpret_cast<LPARAM>(text.c_str()));
+}
+
std::wstring TextField::Edit::GetSelectedText() const {
// Figure out the length of the selection.
long start;
@@ -953,6 +961,12 @@
edit_->SetText(text);
}
+void TextField::AppendText(const std::wstring& text) {
+ text_ += text;
+ if (edit_)
+ edit_->AppendText(text);
+}
+
void TextField::CalculateInsets(gfx::Insets* insets) {
DCHECK(insets);
« chrome/browser/views/about_network_dialog.cc ('K') | « chrome/views/text_field.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698