| 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/gtk/bookmark_context_menu_gtk.h" | 5 #include "chrome/browser/gtk/bookmark_context_menu_gtk.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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 NOTREACHED(); | 331 NOTREACHED(); |
| 332 return; | 332 return; |
| 333 } | 333 } |
| 334 | 334 |
| 335 if (selection_[0]->is_url()) { | 335 if (selection_[0]->is_url()) { |
| 336 BookmarkEditor::Configuration editor_config; | 336 BookmarkEditor::Configuration editor_config; |
| 337 if (configuration_ == BOOKMARK_BAR) | 337 if (configuration_ == BOOKMARK_BAR) |
| 338 editor_config = BookmarkEditor::SHOW_TREE; | 338 editor_config = BookmarkEditor::SHOW_TREE; |
| 339 else | 339 else |
| 340 editor_config = BookmarkEditor::NO_TREE; | 340 editor_config = BookmarkEditor::NO_TREE; |
| 341 BookmarkEditor::Show(wnd_, profile_, parent_, selection_[0], | 341 BookmarkEditor::Show(wnd_, profile_, parent_, |
| 342 BookmarkEditor::EditDetails(selection_[0]), |
| 342 editor_config, NULL); | 343 editor_config, NULL); |
| 343 } else { | 344 } else { |
| 344 EditFolderController::Show(profile_, wnd_, selection_[0], false, | 345 EditFolderController::Show(profile_, wnd_, selection_[0], false, |
| 345 false); | 346 false); |
| 346 } | 347 } |
| 347 break; | 348 break; |
| 348 | 349 |
| 349 case IDS_BOOKMARK_BAR_REMOVE: { | 350 case IDS_BOOKMARK_BAR_REMOVE: { |
| 350 UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Remove", profile_); | 351 UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Remove", profile_); |
| 351 BookmarkModel* model = RemoveModelObserver(); | 352 BookmarkModel* model = RemoveModelObserver(); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 363 | 364 |
| 364 BookmarkEditor::Configuration editor_config; | 365 BookmarkEditor::Configuration editor_config; |
| 365 BookmarkEditor::Handler* handler = NULL; | 366 BookmarkEditor::Handler* handler = NULL; |
| 366 if (configuration_ == BOOKMARK_BAR) { | 367 if (configuration_ == BOOKMARK_BAR) { |
| 367 editor_config = BookmarkEditor::SHOW_TREE; | 368 editor_config = BookmarkEditor::SHOW_TREE; |
| 368 } else { | 369 } else { |
| 369 editor_config = BookmarkEditor::NO_TREE; | 370 editor_config = BookmarkEditor::NO_TREE; |
| 370 // This is owned by the BookmarkEditorView. | 371 // This is owned by the BookmarkEditorView. |
| 371 handler = new SelectOnCreationHandler(profile_); | 372 handler = new SelectOnCreationHandler(profile_); |
| 372 } | 373 } |
| 373 BookmarkEditor::Show(wnd_, profile_, GetParentForNewNodes(), NULL, | 374 BookmarkEditor::Show(wnd_, profile_, GetParentForNewNodes(), |
| 374 editor_config, handler); | 375 BookmarkEditor::EditDetails(), editor_config, |
| 376 handler); |
| 375 break; | 377 break; |
| 376 } | 378 } |
| 377 | 379 |
| 378 case IDS_BOOMARK_BAR_NEW_FOLDER: { | 380 case IDS_BOOMARK_BAR_NEW_FOLDER: { |
| 379 UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_NewFolder", | 381 UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_NewFolder", |
| 380 profile_); | 382 profile_); |
| 381 EditFolderController::Show(profile_, wnd_, GetParentForNewNodes(), | 383 EditFolderController::Show(profile_, wnd_, GetParentForNewNodes(), |
| 382 true, (configuration_ != BOOKMARK_BAR)); | 384 true, (configuration_ != BOOKMARK_BAR)); |
| 383 break; | 385 break; |
| 384 } | 386 } |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 if (NodeHasURLs(selection_[i])) | 557 if (NodeHasURLs(selection_[i])) |
| 556 return true; | 558 return true; |
| 557 } | 559 } |
| 558 return false; | 560 return false; |
| 559 } | 561 } |
| 560 | 562 |
| 561 const BookmarkNode* BookmarkContextMenuGtk::GetParentForNewNodes() const { | 563 const BookmarkNode* BookmarkContextMenuGtk::GetParentForNewNodes() const { |
| 562 return (selection_.size() == 1 && selection_[0]->is_folder()) ? | 564 return (selection_.size() == 1 && selection_[0]->is_folder()) ? |
| 563 selection_[0] : parent_; | 565 selection_[0] : parent_; |
| 564 } | 566 } |
| OLD | NEW |