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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc

Issue 138363004: Views Textfield fixes and cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync and rebase. Created 6 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
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/views/bookmarks/bookmark_editor_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_editor_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 } else if (details_.type == EditDetails::NEW_FOLDER) { 273 } else if (details_.type == EditDetails::NEW_FOLDER) {
274 title = l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NEW_FOLDER_NAME); 274 title = l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NEW_FOLDER_NAME);
275 } else if (details_.type == EditDetails::NEW_URL) { 275 } else if (details_.type == EditDetails::NEW_URL) {
276 url = details_.url; 276 url = details_.url;
277 title = details_.title; 277 title = details_.title;
278 } 278 }
279 title_tf_ = new views::Textfield; 279 title_tf_ = new views::Textfield;
280 title_tf_->SetAccessibleName( 280 title_tf_->SetAccessibleName(
281 l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_EDITOR_NAME_LABEL)); 281 l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_EDITOR_NAME_LABEL));
282 title_tf_->SetText(title); 282 title_tf_->SetText(title);
283 title_tf_->SetController(this); 283 title_tf_->set_controller(this);
284 284
285 if (show_tree_) { 285 if (show_tree_) {
286 tree_view_ = new views::TreeView; 286 tree_view_ = new views::TreeView;
287 tree_view_->SetRootShown(false); 287 tree_view_->SetRootShown(false);
288 tree_view_->set_context_menu_controller(this); 288 tree_view_->set_context_menu_controller(this);
289 289
290 new_folder_button_.reset(new views::LabelButton(this, 290 new_folder_button_.reset(new views::LabelButton(this,
291 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NEW_FOLDER_BUTTON))); 291 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_NEW_FOLDER_BUTTON)));
292 new_folder_button_->SetStyle(views::Button::STYLE_BUTTON); 292 new_folder_button_->SetStyle(views::Button::STYLE_BUTTON);
293 new_folder_button_->set_owned_by_client(); 293 new_folder_button_->set_owned_by_client();
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 layout->AddView(title_tf_); 328 layout->AddView(title_tf_);
329 329
330 if (details_.GetNodeType() != BookmarkNode::FOLDER) { 330 if (details_.GetNodeType() != BookmarkNode::FOLDER) {
331 url_label_ = new views::Label( 331 url_label_ = new views::Label(
332 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_URL_LABEL)); 332 l10n_util::GetStringUTF16(IDS_BOOKMARK_EDITOR_URL_LABEL));
333 333
334 url_tf_ = new views::Textfield; 334 url_tf_ = new views::Textfield;
335 PrefService* prefs = 335 PrefService* prefs =
336 profile_ ? user_prefs::UserPrefs::Get(profile_) : NULL; 336 profile_ ? user_prefs::UserPrefs::Get(profile_) : NULL;
337 url_tf_->SetText(chrome::FormatBookmarkURLForDisplay(url, prefs)); 337 url_tf_->SetText(chrome::FormatBookmarkURLForDisplay(url, prefs));
338 url_tf_->SetController(this); 338 url_tf_->set_controller(this);
339 url_tf_->SetAccessibleName( 339 url_tf_->SetAccessibleName(
340 l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_EDITOR_URL_LABEL)); 340 l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_EDITOR_URL_LABEL));
341 341
342 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); 342 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
343 343
344 layout->StartRow(0, labels_column_set_id); 344 layout->StartRow(0, labels_column_set_id);
345 layout->AddView(url_label_); 345 layout->AddView(url_label_);
346 layout->AddView(url_tf_); 346 layout->AddView(url_tf_);
347 } 347 }
348 348
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
625 } 625 }
626 return context_menu_model_.get(); 626 return context_menu_model_.get();
627 } 627 }
628 628
629 void BookmarkEditorView::EditorTreeModel::SetTitle( 629 void BookmarkEditorView::EditorTreeModel::SetTitle(
630 ui::TreeModelNode* node, 630 ui::TreeModelNode* node,
631 const base::string16& title) { 631 const base::string16& title) {
632 if (!title.empty()) 632 if (!title.empty())
633 ui::TreeNodeModel<EditorNode>::SetTitle(node, title); 633 ui::TreeNodeModel<EditorNode>::SetTitle(node, title);
634 } 634 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/autofill/decorated_textfield.cc ('k') | chrome/browser/ui/views/crypto_module_password_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698