| 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_bubble_view.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 BookmarkEditor::SHOW_TREE); | 346 BookmarkEditor::SHOW_TREE); |
| 347 } | 347 } |
| 348 | 348 |
| 349 void BookmarkBubbleView::ApplyEdits() { | 349 void BookmarkBubbleView::ApplyEdits() { |
| 350 // Set this to make sure we don't attempt to apply edits again. | 350 // Set this to make sure we don't attempt to apply edits again. |
| 351 apply_edits_ = false; | 351 apply_edits_ = false; |
| 352 | 352 |
| 353 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile_); | 353 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile_); |
| 354 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_); | 354 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_); |
| 355 if (node) { | 355 if (node) { |
| 356 const base::string16 new_title = title_tf_->text(); | 356 const base::string16 new_title = title_tf_->GetText(); |
| 357 if (new_title != node->GetTitle()) { | 357 if (new_title != node->GetTitle()) { |
| 358 model->SetTitle(node, new_title); | 358 model->SetTitle(node, new_title); |
| 359 content::RecordAction( | 359 content::RecordAction( |
| 360 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); | 360 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); |
| 361 } | 361 } |
| 362 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); | 362 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); |
| 363 } | 363 } |
| 364 } | 364 } |
| OLD | NEW |