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/ui/views/bookmarks/bookmark_context_menu_controller_vie
ws.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_vie
ws.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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 void BookmarkContextMenuControllerViews::ExecuteCommand(int id) { | 97 void BookmarkContextMenuControllerViews::ExecuteCommand(int id) { |
98 BookmarkModel* model = RemoveModelObserver(); | 98 BookmarkModel* model = RemoveModelObserver(); |
99 | 99 |
100 switch (id) { | 100 switch (id) { |
101 case IDC_BOOKMARK_BAR_OPEN_ALL: | 101 case IDC_BOOKMARK_BAR_OPEN_ALL: |
102 case IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO: | 102 case IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO: |
103 case IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW: { | 103 case IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW: { |
104 WindowOpenDisposition initial_disposition; | 104 WindowOpenDisposition initial_disposition; |
105 if (id == IDC_BOOKMARK_BAR_OPEN_ALL) { | 105 if (id == IDC_BOOKMARK_BAR_OPEN_ALL) { |
106 initial_disposition = NEW_FOREGROUND_TAB; | 106 initial_disposition = NEW_BACKGROUND_TAB; |
107 content::RecordAction( | 107 content::RecordAction( |
108 UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); | 108 UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); |
109 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { | 109 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { |
110 initial_disposition = NEW_WINDOW; | 110 initial_disposition = NEW_WINDOW; |
111 content::RecordAction( | 111 content::RecordAction( |
112 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); | 112 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); |
113 } else { | 113 } else { |
114 initial_disposition = OFF_THE_RECORD; | 114 initial_disposition = OFF_THE_RECORD; |
115 content::RecordAction( | 115 content::RecordAction( |
116 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); | 116 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 return model; | 304 return model; |
305 } | 305 } |
306 | 306 |
307 bool BookmarkContextMenuControllerViews::HasURLs() const { | 307 bool BookmarkContextMenuControllerViews::HasURLs() const { |
308 for (size_t i = 0; i < selection_.size(); ++i) { | 308 for (size_t i = 0; i < selection_.size(); ++i) { |
309 if (bookmark_utils::NodeHasURLs(selection_[i])) | 309 if (bookmark_utils::NodeHasURLs(selection_[i])) |
310 return true; | 310 return true; |
311 } | 311 } |
312 return false; | 312 return false; |
313 } | 313 } |
OLD | NEW |