| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/bookmark_editor_view.h" | 5 #include "chrome/browser/views/bookmark_editor_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 context_menu_.reset(); | 380 context_menu_.reset(); |
| 381 | 381 |
| 382 if (GetParent()) { | 382 if (GetParent()) { |
| 383 ExpandAndSelect(); | 383 ExpandAndSelect(); |
| 384 } else if (GetParent()) { | 384 } else if (GetParent()) { |
| 385 tree_view_->ExpandAll(); | 385 tree_view_->ExpandAll(); |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 GURL BookmarkEditorView::GetInputURL() const { | 388 GURL BookmarkEditorView::GetInputURL() const { |
| 389 std::wstring input = URLFixerUpper::FixupURL(url_tf_.GetText(), L""); | 389 std::wstring input = URLFixerUpper::FixupURL(url_tf_.text(), L""); |
| 390 return GURL(input); | 390 return GURL(input); |
| 391 } | 391 } |
| 392 | 392 |
| 393 std::wstring BookmarkEditorView::GetInputTitle() const { | 393 std::wstring BookmarkEditorView::GetInputTitle() const { |
| 394 return title_tf_.GetText(); | 394 return title_tf_.text(); |
| 395 } | 395 } |
| 396 | 396 |
| 397 void BookmarkEditorView::UserInputChanged() { | 397 void BookmarkEditorView::UserInputChanged() { |
| 398 const GURL url(GetInputURL()); | 398 const GURL url(GetInputURL()); |
| 399 if (!url.is_valid()) | 399 if (!url.is_valid()) |
| 400 url_tf_.SetBackgroundColor(kErrorColor); | 400 url_tf_.SetBackgroundColor(kErrorColor); |
| 401 else | 401 else |
| 402 url_tf_.SetDefaultBackgroundColor(); | 402 url_tf_.UseDefaultBackgroundColor(); |
| 403 GetDialogClientView()->UpdateDialogButtons(); | 403 GetDialogClientView()->UpdateDialogButtons(); |
| 404 } | 404 } |
| 405 | 405 |
| 406 void BookmarkEditorView::NewGroup() { | 406 void BookmarkEditorView::NewGroup() { |
| 407 // Create a new entry parented to the selected item, or the bookmark | 407 // Create a new entry parented to the selected item, or the bookmark |
| 408 // bar if nothing is selected. | 408 // bar if nothing is selected. |
| 409 EditorNode* parent = tree_model_->AsNode(tree_view_->GetSelectedNode()); | 409 EditorNode* parent = tree_model_->AsNode(tree_view_->GetSelectedNode()); |
| 410 if (!parent) { | 410 if (!parent) { |
| 411 NOTREACHED(); | 411 NOTREACHED(); |
| 412 return; | 412 return; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 break; | 538 break; |
| 539 } | 539 } |
| 540 } | 540 } |
| 541 DCHECK(child_bb_node); | 541 DCHECK(child_bb_node); |
| 542 bb_model_->SetTitle(child_bb_node, child_b_node->GetTitle()); | 542 bb_model_->SetTitle(child_bb_node, child_b_node->GetTitle()); |
| 543 } | 543 } |
| 544 ApplyNameChangesAndCreateNewGroups(child_bb_node, child_b_node, | 544 ApplyNameChangesAndCreateNewGroups(child_bb_node, child_b_node, |
| 545 parent_b_node, parent_bb_node); | 545 parent_b_node, parent_bb_node); |
| 546 } | 546 } |
| 547 } | 547 } |
| OLD | NEW |