| 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_model.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 8 #include "chrome/browser/bookmarks/bookmark_stats.h" | 10 #include "chrome/browser/bookmarks/bookmark_stats.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 12 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 11 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_finder.h" | 14 #include "chrome/browser/ui/browser_finder.h" |
| 13 #include "chrome/browser/ui/browser_window.h" | 15 #include "chrome/browser/ui/browser_window.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 16 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 15 #include "content/public/browser/page_navigator.h" | 17 #include "content/public/browser/page_navigator.h" |
| 16 #include "content/public/browser/user_metrics.h" | 18 #include "content/public/browser/user_metrics.h" |
| 17 #include "content/public/browser/web_contents.h" | 19 #include "content/public/browser/web_contents.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 false, | 117 false, |
| 116 chrome::HOST_DESKTOP_TYPE_NATIVE); | 118 chrome::HOST_DESKTOP_TYPE_NATIVE); |
| 117 PageNavigator* navigator = NULL; | 119 PageNavigator* navigator = NULL; |
| 118 if (!browser || !browser->tab_strip_model()->GetActiveWebContents()) { | 120 if (!browser || !browser->tab_strip_model()->GetActiveWebContents()) { |
| 119 navigator = &navigator_impl; | 121 navigator = &navigator_impl; |
| 120 } else { | 122 } else { |
| 121 browser->window()->Activate(); | 123 browser->window()->Activate(); |
| 122 navigator = browser->tab_strip_model()->GetActiveWebContents(); | 124 navigator = browser->tab_strip_model()->GetActiveWebContents(); |
| 123 } | 125 } |
| 124 | 126 |
| 127 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile_); |
| 125 chrome::OpenAll(parent_window_, navigator, selection_, | 128 chrome::OpenAll(parent_window_, navigator, selection_, |
| 126 NEW_FOREGROUND_TAB, profile_to_use); | 129 NEW_FOREGROUND_TAB, profile_to_use); |
| 127 for (size_t i = 0; i < selection_.size(); ++i) { | 130 for (size_t i = 0; i < selection_.size(); ++i) { |
| 128 RecordBookmarkLaunch(selection_[i], | 131 RecordBookmarkLaunch( |
| 129 BOOKMARK_LAUNCH_LOCATION_CONTEXT_MENU); | 132 model, selection_[i], BOOKMARK_LAUNCH_LOCATION_CONTEXT_MENU); |
| 130 } | 133 } |
| 131 return true; | 134 return true; |
| 132 } | 135 } |
| 133 | 136 |
| 134 default: | 137 default: |
| 135 break; | 138 break; |
| 136 } | 139 } |
| 137 } | 140 } |
| 138 | 141 |
| 139 return false; | 142 return false; |
| 140 } | 143 } |
| OLD | NEW |