| OLD | NEW |
| 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 Loading... |
| 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_NATIVE_TEXTBUTTON); | 292 new_folder_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON); |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |