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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 void BookmarkContextMenuController::ExecuteCommand(int id) { | 106 void BookmarkContextMenuController::ExecuteCommand(int id) { |
107 if (delegate_) | 107 if (delegate_) |
108 delegate_->WillExecuteCommand(); | 108 delegate_->WillExecuteCommand(); |
109 | 109 |
110 switch (id) { | 110 switch (id) { |
111 case IDC_BOOKMARK_BAR_OPEN_ALL: | 111 case IDC_BOOKMARK_BAR_OPEN_ALL: |
112 case IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO: | 112 case IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO: |
113 case IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW: { | 113 case IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW: { |
114 WindowOpenDisposition initial_disposition; | 114 WindowOpenDisposition initial_disposition; |
115 if (id == IDC_BOOKMARK_BAR_OPEN_ALL) { | 115 if (id == IDC_BOOKMARK_BAR_OPEN_ALL) { |
116 initial_disposition = NEW_FOREGROUND_TAB; | 116 initial_disposition = NEW_BACKGROUND_TAB; |
117 content::RecordAction( | 117 content::RecordAction( |
118 UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); | 118 UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); |
119 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { | 119 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { |
120 initial_disposition = NEW_WINDOW; | 120 initial_disposition = NEW_WINDOW; |
121 content::RecordAction( | 121 content::RecordAction( |
122 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); | 122 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); |
123 } else { | 123 } else { |
124 initial_disposition = OFF_THE_RECORD; | 124 initial_disposition = OFF_THE_RECORD; |
125 content::RecordAction( | 125 content::RecordAction( |
126 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); | 126 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 delegate_->CloseMenu(); | 313 delegate_->CloseMenu(); |
314 } | 314 } |
315 | 315 |
316 bool BookmarkContextMenuController::HasURLs() const { | 316 bool BookmarkContextMenuController::HasURLs() const { |
317 for (size_t i = 0; i < selection_.size(); ++i) { | 317 for (size_t i = 0; i < selection_.size(); ++i) { |
318 if (bookmark_utils::NodeHasURLs(selection_[i])) | 318 if (bookmark_utils::NodeHasURLs(selection_[i])) |
319 return true; | 319 return true; |
320 } | 320 } |
321 return false; | 321 return false; |
322 } | 322 } |
OLD | NEW |