| 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/string16.h" | 7 #include "base/string16.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 this, l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_OPTIONS)); | 162 this, l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_OPTIONS)); |
| 163 | 163 |
| 164 close_button_ = new views::NativeTextButton( | 164 close_button_ = new views::NativeTextButton( |
| 165 this, l10n_util::GetStringUTF16(IDS_DONE)); | 165 this, l10n_util::GetStringUTF16(IDS_DONE)); |
| 166 close_button_->SetIsDefault(true); | 166 close_button_->SetIsDefault(true); |
| 167 | 167 |
| 168 views::Label* combobox_label = new views::Label( | 168 views::Label* combobox_label = new views::Label( |
| 169 l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_FOLDER_TEXT)); | 169 l10n_util::GetStringUTF16(IDS_BOOKMARK_BUBBLE_FOLDER_TEXT)); |
| 170 | 170 |
| 171 parent_combobox_ = new views::Combobox(&parent_model_); | 171 parent_combobox_ = new views::Combobox(&parent_model_); |
| 172 parent_combobox_->SetSelectedItem(parent_model_.node_parent_index()); | 172 parent_combobox_->SetSelectedIndex(parent_model_.node_parent_index()); |
| 173 parent_combobox_->set_listener(this); | 173 parent_combobox_->set_listener(this); |
| 174 parent_combobox_->SetAccessibleName(combobox_label->text()); | 174 parent_combobox_->SetAccessibleName(combobox_label->text()); |
| 175 | 175 |
| 176 views::Label* title_label = new views::Label( | 176 views::Label* title_label = new views::Label( |
| 177 l10n_util::GetStringUTF16( | 177 l10n_util::GetStringUTF16( |
| 178 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : | 178 newly_bookmarked_ ? IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARKED : |
| 179 IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARK)); | 179 IDS_BOOKMARK_BUBBLE_PAGE_BOOKMARK)); |
| 180 title_label->SetFont( | 180 title_label->SetFont( |
| 181 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont)); | 181 ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont)); |
| 182 title_label->SetEnabledColor(SkColorSetRGB(6, 45, 117)); | 182 title_label->SetEnabledColor(SkColorSetRGB(6, 45, 117)); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 BookmarkModel* model = profile_->GetBookmarkModel(); | 327 BookmarkModel* model = profile_->GetBookmarkModel(); |
| 328 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_); | 328 const BookmarkNode* node = model->GetMostRecentlyAddedNodeForURL(url_); |
| 329 if (node) { | 329 if (node) { |
| 330 const string16 new_title = title_tf_->text(); | 330 const string16 new_title = title_tf_->text(); |
| 331 if (new_title != node->GetTitle()) { | 331 if (new_title != node->GetTitle()) { |
| 332 model->SetTitle(node, new_title); | 332 model->SetTitle(node, new_title); |
| 333 content::RecordAction( | 333 content::RecordAction( |
| 334 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); | 334 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); |
| 335 } | 335 } |
| 336 // Last index means 'Choose another folder...' | 336 // Last index means 'Choose another folder...' |
| 337 if (parent_combobox_->selected_item() < parent_model_.GetItemCount() - 1) { | 337 if (parent_combobox_->selected_index() < parent_model_.GetItemCount() - 1) { |
| 338 const BookmarkNode* new_parent = | 338 const BookmarkNode* new_parent = |
| 339 parent_model_.GetNodeAt(parent_combobox_->selected_item()); | 339 parent_model_.GetNodeAt(parent_combobox_->selected_index()); |
| 340 if (new_parent != node->parent()) { | 340 if (new_parent != node->parent()) { |
| 341 content::RecordAction( | 341 content::RecordAction( |
| 342 UserMetricsAction("BookmarkBubble_ChangeParent")); | 342 UserMetricsAction("BookmarkBubble_ChangeParent")); |
| 343 model->Move(node, new_parent, new_parent->child_count()); | 343 model->Move(node, new_parent, new_parent->child_count()); |
| 344 } | 344 } |
| 345 } | 345 } |
| 346 } | 346 } |
| 347 } | 347 } |
| OLD | NEW |