| 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/bookmarks/bookmark_context_menu_controller.h" | 5 #include "chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h" |
| 6 | 6 |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_stats.h" | 8 #include "chrome/browser/bookmarks/bookmark_stats.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 10 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 PageNavigator* navigator = NULL; | 117 PageNavigator* navigator = NULL; |
| 118 if (!browser || !browser->tab_strip_model()->GetActiveWebContents()) { | 118 if (!browser || !browser->tab_strip_model()->GetActiveWebContents()) { |
| 119 navigator = &navigator_impl; | 119 navigator = &navigator_impl; |
| 120 } else { | 120 } else { |
| 121 browser->window()->Activate(); | 121 browser->window()->Activate(); |
| 122 navigator = browser->tab_strip_model()->GetActiveWebContents(); | 122 navigator = browser->tab_strip_model()->GetActiveWebContents(); |
| 123 } | 123 } |
| 124 | 124 |
| 125 chrome::OpenAll(parent_window_, navigator, selection_, | 125 chrome::OpenAll(parent_window_, navigator, selection_, |
| 126 NEW_FOREGROUND_TAB, profile_to_use); | 126 NEW_FOREGROUND_TAB, profile_to_use); |
| 127 RecordBookmarkLaunch(BOOKMARK_LAUNCH_LOCATION_CONTEXT_MENU); | 127 for (size_t i = 0; i < selection_.size(); ++i) { |
| 128 RecordBookmarkLaunch(selection_[i], |
| 129 BOOKMARK_LAUNCH_LOCATION_CONTEXT_MENU); |
| 130 } |
| 128 return true; | 131 return true; |
| 129 } | 132 } |
| 130 | 133 |
| 131 default: | 134 default: |
| 132 break; | 135 break; |
| 133 } | 136 } |
| 134 } | 137 } |
| 135 | 138 |
| 136 return false; | 139 return false; |
| 137 } | 140 } |
| OLD | NEW |