| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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.h" | 5 #include "chrome/browser/bookmarks/bookmark_context_menu.h" |
| 6 | 6 |
| 7 #include "chrome/browser/bookmarks/bookmark_model.h" | 7 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_utils.h" | 8 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #include "chrome/browser/browser_list.h" | 10 #include "chrome/browser/browser_list.h" |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 if (selection_.size() != 1) { | 402 if (selection_.size() != 1) { |
| 403 NOTREACHED(); | 403 NOTREACHED(); |
| 404 return; | 404 return; |
| 405 } | 405 } |
| 406 | 406 |
| 407 if (BookmarkManagerView::current()) | 407 if (BookmarkManagerView::current()) |
| 408 BookmarkManagerView::current()->SelectInTree(selection_[0]); | 408 BookmarkManagerView::current()->SelectInTree(selection_[0]); |
| 409 break; | 409 break; |
| 410 | 410 |
| 411 case IDS_BOOKMARK_MANAGER: | 411 case IDS_BOOKMARK_MANAGER: |
| 412 UserMetrics::RecordAction(L"ShowBookmarkManager", profile_); |
| 412 BookmarkManagerView::Show(profile_); | 413 BookmarkManagerView::Show(profile_); |
| 413 break; | 414 break; |
| 414 | 415 |
| 415 default: | 416 default: |
| 416 NOTREACHED(); | 417 NOTREACHED(); |
| 417 } | 418 } |
| 418 } | 419 } |
| 419 | 420 |
| 420 bool BookmarkContextMenu::IsItemChecked(int id) const { | 421 bool BookmarkContextMenu::IsItemChecked(int id) const { |
| 421 DCHECK(id == IDS_BOOMARK_BAR_ALWAYS_SHOW); | 422 DCHECK(id == IDS_BOOMARK_BAR_ALWAYS_SHOW); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 if (NodeHasURLs(selection_[i])) | 502 if (NodeHasURLs(selection_[i])) |
| 502 return true; | 503 return true; |
| 503 } | 504 } |
| 504 return false; | 505 return false; |
| 505 } | 506 } |
| 506 | 507 |
| 507 BookmarkNode* BookmarkContextMenu::GetParentForNewNodes() const { | 508 BookmarkNode* BookmarkContextMenu::GetParentForNewNodes() const { |
| 508 return (selection_.size() == 1 && selection_[0]->is_folder()) ? | 509 return (selection_.size() == 1 && selection_[0]->is_folder()) ? |
| 509 selection_[0] : parent_; | 510 selection_[0] : parent_; |
| 510 } | 511 } |
| OLD | NEW |