| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 } | 182 } |
| 183 | 183 |
| 184 void BookmarkEditorView::ContentsChanged(Textfield* sender, | 184 void BookmarkEditorView::ContentsChanged(Textfield* sender, |
| 185 const std::wstring& new_contents) { | 185 const std::wstring& new_contents) { |
| 186 UserInputChanged(); | 186 UserInputChanged(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void BookmarkEditorView::ButtonPressed( | 189 void BookmarkEditorView::ButtonPressed( |
| 190 Button* sender, const views::Event& event) { | 190 Button* sender, const views::Event& event) { |
| 191 DCHECK(sender); | 191 DCHECK(sender); |
| 192 switch (sender->GetID()) { | 192 switch (sender->id()) { |
| 193 case kNewFolderButtonID: | 193 case kNewFolderButtonID: |
| 194 NewFolder(); | 194 NewFolder(); |
| 195 break; | 195 break; |
| 196 | 196 |
| 197 default: | 197 default: |
| 198 NOTREACHED(); | 198 NOTREACHED(); |
| 199 } | 199 } |
| 200 } | 200 } |
| 201 | 201 |
| 202 bool BookmarkEditorView::IsCommandIdChecked(int command_id) const { | 202 bool BookmarkEditorView::IsCommandIdChecked(int command_id) const { |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 tree_view_ = new views::TreeView(); | 304 tree_view_ = new views::TreeView(); |
| 305 new_folder_button_.reset(new views::NativeButton( | 305 new_folder_button_.reset(new views::NativeButton( |
| 306 this, | 306 this, |
| 307 UTF16ToWide(l10n_util::GetStringUTF16( | 307 UTF16ToWide(l10n_util::GetStringUTF16( |
| 308 IDS_BOOMARK_EDITOR_NEW_FOLDER_BUTTON)))); | 308 IDS_BOOMARK_EDITOR_NEW_FOLDER_BUTTON)))); |
| 309 new_folder_button_->set_parent_owned(false); | 309 new_folder_button_->set_parent_owned(false); |
| 310 tree_view_->SetContextMenuController(this); | 310 tree_view_->SetContextMenuController(this); |
| 311 | 311 |
| 312 tree_view_->SetRootShown(false); | 312 tree_view_->SetRootShown(false); |
| 313 new_folder_button_->SetEnabled(false); | 313 new_folder_button_->SetEnabled(false); |
| 314 new_folder_button_->SetID(kNewFolderButtonID); | 314 new_folder_button_->set_id(kNewFolderButtonID); |
| 315 } | 315 } |
| 316 | 316 |
| 317 // Yummy layout code. | 317 // Yummy layout code. |
| 318 GridLayout* layout = GridLayout::CreatePanel(this); | 318 GridLayout* layout = GridLayout::CreatePanel(this); |
| 319 SetLayoutManager(layout); | 319 SetLayoutManager(layout); |
| 320 | 320 |
| 321 const int labels_column_set_id = 0; | 321 const int labels_column_set_id = 0; |
| 322 const int single_column_view_set_id = 1; | 322 const int single_column_view_set_id = 1; |
| 323 const int buttons_column_set_id = 2; | 323 const int buttons_column_set_id = 2; |
| 324 | 324 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 break; | 580 break; |
| 581 } | 581 } |
| 582 } | 582 } |
| 583 DCHECK(child_bb_node); | 583 DCHECK(child_bb_node); |
| 584 bb_model_->SetTitle(child_bb_node, child_b_node->GetTitle()); | 584 bb_model_->SetTitle(child_bb_node, child_b_node->GetTitle()); |
| 585 } | 585 } |
| 586 ApplyNameChangesAndCreateNewFolders(child_bb_node, child_b_node, | 586 ApplyNameChangesAndCreateNewFolders(child_bb_node, child_b_node, |
| 587 parent_b_node, parent_bb_node); | 587 parent_b_node, parent_bb_node); |
| 588 } | 588 } |
| 589 } | 589 } |
| OLD | NEW |