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/bookmarks/bookmark_context_menu_controller.h" | 5 #include "chrome/browser/bookmarks/bookmark_context_menu_controller.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/bookmarks/bookmark_editor.h" | 9 #include "chrome/browser/bookmarks/bookmark_editor.h" |
10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); | 121 UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); |
122 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { | 122 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { |
123 initial_disposition = NEW_WINDOW; | 123 initial_disposition = NEW_WINDOW; |
124 content::RecordAction( | 124 content::RecordAction( |
125 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); | 125 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); |
126 } else { | 126 } else { |
127 initial_disposition = OFF_THE_RECORD; | 127 initial_disposition = OFF_THE_RECORD; |
128 content::RecordAction( | 128 content::RecordAction( |
129 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); | 129 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); |
130 } | 130 } |
131 bookmark_utils::OpenAll(parent_window_, profile_, navigator_, selection_, | 131 bookmark_utils::OpenAll(parent_window_, navigator_, selection_, |
132 initial_disposition); | 132 initial_disposition); |
133 break; | 133 break; |
134 } | 134 } |
135 | 135 |
136 case IDC_BOOKMARK_BAR_RENAME_FOLDER: | 136 case IDC_BOOKMARK_BAR_RENAME_FOLDER: |
137 case IDC_BOOKMARK_BAR_EDIT: | 137 case IDC_BOOKMARK_BAR_EDIT: |
138 content::RecordAction( | 138 content::RecordAction( |
139 UserMetricsAction("BookmarkBar_ContextMenu_Edit")); | 139 UserMetricsAction("BookmarkBar_ContextMenu_Edit")); |
140 | 140 |
141 if (selection_.size() != 1) { | 141 if (selection_.size() != 1) { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 delegate_->CloseMenu(); | 318 delegate_->CloseMenu(); |
319 } | 319 } |
320 | 320 |
321 bool BookmarkContextMenuController::HasURLs() const { | 321 bool BookmarkContextMenuController::HasURLs() const { |
322 for (size_t i = 0; i < selection_.size(); ++i) { | 322 for (size_t i = 0; i < selection_.size(); ++i) { |
323 if (bookmark_utils::NodeHasURLs(selection_[i])) | 323 if (bookmark_utils::NodeHasURLs(selection_[i])) |
324 return true; | 324 return true; |
325 } | 325 } |
326 return false; | 326 return false; |
327 } | 327 } |
OLD | NEW |