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

Side by Side Diff: chrome/browser/ui/views/textfield_views.cc

Issue 6204002: Carnitas: Remove chrome/browser/views, update references. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yay, more syncing Created 9 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/views/textfield_views.h ('k') | chrome/browser/ui/views/theme_background.cc » ('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) 2010 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 #include "chrome/browser/views/textfield_views.h" 5 #include "chrome/browser/ui/views/textfield_views.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/dom_ui/textfields_ui.h" 9 #include "chrome/browser/dom_ui/textfields_ui.h"
10 #include "chrome/browser/tab_contents/tab_contents.h" 10 #include "chrome/browser/tab_contents/tab_contents.h"
11 11
12 TextfieldViews::TextfieldViews() : DOMView() {} 12 TextfieldViews::TextfieldViews() : DOMView() {}
13 13
14 std::wstring TextfieldViews::GetText() { 14 std::wstring TextfieldViews::GetText() {
15 TextfieldsUI* textfields_ui = dom_ui(); 15 TextfieldsUI* textfields_ui = dom_ui();
16 return (textfields_ui) ? textfields_ui->text() : std::wstring(); 16 return (textfields_ui) ? textfields_ui->text() : std::wstring();
17 } 17 }
18 18
19 void TextfieldViews::SetText(const std::wstring& text) { 19 void TextfieldViews::SetText(const std::wstring& text) {
20 TextfieldsUI* textfields_ui = dom_ui(); 20 TextfieldsUI* textfields_ui = dom_ui();
21 if (textfields_ui) { 21 if (textfields_ui) {
22 StringValue text_value(WideToUTF16(text)); 22 StringValue text_value(WideToUTF16(text));
23 textfields_ui->CallJavascriptFunction(L"setTextfieldValue", text_value); 23 textfields_ui->CallJavascriptFunction(L"setTextfieldValue", text_value);
24 } 24 }
25 SchedulePaint(); 25 SchedulePaint();
26 } 26 }
27 27
28 TextfieldsUI* TextfieldViews::dom_ui() { 28 TextfieldsUI* TextfieldViews::dom_ui() {
29 TextfieldsUI* dom_ui = NULL; 29 TextfieldsUI* dom_ui = NULL;
30 if (tab_contents_.get() && tab_contents_->dom_ui()) { 30 if (tab_contents_.get() && tab_contents_->dom_ui()) {
31 dom_ui = static_cast<TextfieldsUI*>(tab_contents_->dom_ui()); 31 dom_ui = static_cast<TextfieldsUI*>(tab_contents_->dom_ui());
32 } 32 }
33 return dom_ui; 33 return dom_ui;
34 } 34 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/textfield_views.h ('k') | chrome/browser/ui/views/theme_background.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698