| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/bookmarks/bookmark_context_menu_controller.h" | 5 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_editor.h" | 9 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_manager.h" | 10 #include "chrome/browser/bookmarks/bookmark_manager.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 NOTREACHED(); | 309 NOTREACHED(); |
| 310 return; | 310 return; |
| 311 } | 311 } |
| 312 | 312 |
| 313 if (selection_[0]->is_url()) { | 313 if (selection_[0]->is_url()) { |
| 314 BookmarkEditor::Configuration editor_config; | 314 BookmarkEditor::Configuration editor_config; |
| 315 if (configuration_ == BOOKMARK_BAR) | 315 if (configuration_ == BOOKMARK_BAR) |
| 316 editor_config = BookmarkEditor::SHOW_TREE; | 316 editor_config = BookmarkEditor::SHOW_TREE; |
| 317 else | 317 else |
| 318 editor_config = BookmarkEditor::NO_TREE; | 318 editor_config = BookmarkEditor::NO_TREE; |
| 319 BookmarkEditor::Show(parent_window_, profile_, parent_, selection_[0], | 319 BookmarkEditor::Show(parent_window_, profile_, parent_, |
| 320 BookmarkEditor::EditDetails(selection_[0]), |
| 320 editor_config, NULL); | 321 editor_config, NULL); |
| 321 } else { | 322 } else { |
| 322 EditFolderController::Show(profile_, parent_window_, selection_[0], | 323 EditFolderController::Show(profile_, parent_window_, selection_[0], |
| 323 false, false); | 324 false, false); |
| 324 } | 325 } |
| 325 break; | 326 break; |
| 326 | 327 |
| 327 case IDS_BOOKMARK_BAR_REMOVE: { | 328 case IDS_BOOKMARK_BAR_REMOVE: { |
| 328 UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Remove", profile_); | 329 UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Remove", profile_); |
| 329 BookmarkModel* model = RemoveModelObserver(); | 330 BookmarkModel* model = RemoveModelObserver(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 342 BookmarkEditor::Configuration editor_config; | 343 BookmarkEditor::Configuration editor_config; |
| 343 BookmarkEditor::Handler* handler = NULL; | 344 BookmarkEditor::Handler* handler = NULL; |
| 344 if (configuration_ == BOOKMARK_BAR) { | 345 if (configuration_ == BOOKMARK_BAR) { |
| 345 editor_config = BookmarkEditor::SHOW_TREE; | 346 editor_config = BookmarkEditor::SHOW_TREE; |
| 346 } else { | 347 } else { |
| 347 editor_config = BookmarkEditor::NO_TREE; | 348 editor_config = BookmarkEditor::NO_TREE; |
| 348 // This is owned by the BookmarkEditorView. | 349 // This is owned by the BookmarkEditorView. |
| 349 handler = new SelectOnCreationHandler(profile_); | 350 handler = new SelectOnCreationHandler(profile_); |
| 350 } | 351 } |
| 351 BookmarkEditor::Show(parent_window_, profile_, GetParentForNewNodes(), | 352 BookmarkEditor::Show(parent_window_, profile_, GetParentForNewNodes(), |
| 352 NULL, editor_config, handler); | 353 BookmarkEditor::EditDetails(), editor_config, |
| 354 handler); |
| 353 break; | 355 break; |
| 354 } | 356 } |
| 355 | 357 |
| 356 case IDS_BOOMARK_BAR_NEW_FOLDER: { | 358 case IDS_BOOMARK_BAR_NEW_FOLDER: { |
| 357 UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_NewFolder", | 359 UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_NewFolder", |
| 358 profile_); | 360 profile_); |
| 359 EditFolderController::Show(profile_, parent_window_, | 361 EditFolderController::Show(profile_, parent_window_, |
| 360 GetParentForNewNodes(), true, | 362 GetParentForNewNodes(), true, |
| 361 configuration_ != BOOKMARK_BAR); | 363 configuration_ != BOOKMARK_BAR); |
| 362 break; | 364 break; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 return true; | 523 return true; |
| 522 } | 524 } |
| 523 return false; | 525 return false; |
| 524 } | 526 } |
| 525 | 527 |
| 526 const BookmarkNode* | 528 const BookmarkNode* |
| 527 BookmarkContextMenuController::GetParentForNewNodes() const { | 529 BookmarkContextMenuController::GetParentForNewNodes() const { |
| 528 return (selection_.size() == 1 && selection_[0]->is_folder()) ? | 530 return (selection_.size() == 1 && selection_[0]->is_folder()) ? |
| 529 selection_[0] : parent_; | 531 selection_[0] : parent_; |
| 530 } | 532 } |
| OLD | NEW |