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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); | 59 UserMetricsAction("BookmarkBar_ContextMenu_OpenAll")); |
60 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { | 60 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { |
61 initial_disposition = NEW_WINDOW; | 61 initial_disposition = NEW_WINDOW; |
62 content::RecordAction( | 62 content::RecordAction( |
63 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); | 63 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); |
64 } else { | 64 } else { |
65 initial_disposition = OFF_THE_RECORD; | 65 initial_disposition = OFF_THE_RECORD; |
66 content::RecordAction( | 66 content::RecordAction( |
67 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); | 67 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); |
68 } | 68 } |
69 bookmark_utils::OpenAll(parent_widget_->GetNativeWindow(), | 69 bookmark_utils::OpenAll(parent_widget_->GetNativeWindow(), navigator_, |
70 profile_, navigator_, selection_, | 70 selection_, initial_disposition); |
71 initial_disposition); | |
72 bookmark_utils::RecordBookmarkLaunch(bookmark_utils::LAUNCH_CONTEXT_MENU); | 71 bookmark_utils::RecordBookmarkLaunch(bookmark_utils::LAUNCH_CONTEXT_MENU); |
73 break; | 72 break; |
74 } | 73 } |
75 | 74 |
76 case IDC_BOOKMARK_BAR_RENAME_FOLDER: | 75 case IDC_BOOKMARK_BAR_RENAME_FOLDER: |
77 case IDC_BOOKMARK_BAR_EDIT: | 76 case IDC_BOOKMARK_BAR_EDIT: |
78 content::RecordAction( | 77 content::RecordAction( |
79 UserMetricsAction("BookmarkBar_ContextMenu_Edit")); | 78 UserMetricsAction("BookmarkBar_ContextMenu_Edit")); |
80 | 79 |
81 if (selection_.size() != 1) { | 80 if (selection_.size() != 1) { |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 return model; | 324 return model; |
326 } | 325 } |
327 | 326 |
328 bool BookmarkContextMenuControllerViews::HasURLs() const { | 327 bool BookmarkContextMenuControllerViews::HasURLs() const { |
329 for (size_t i = 0; i < selection_.size(); ++i) { | 328 for (size_t i = 0; i < selection_.size(); ++i) { |
330 if (bookmark_utils::NodeHasURLs(selection_[i])) | 329 if (bookmark_utils::NodeHasURLs(selection_[i])) |
331 return true; | 330 return true; |
332 } | 331 } |
333 return false; | 332 return false; |
334 } | 333 } |
OLD | NEW |