| 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_win.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_vie
ws_win.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_utils.h" | 8 #include "chrome/browser/bookmarks/bookmark_utils.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 | 117 |
| 118 content::RecordAction( | 118 content::RecordAction( |
| 119 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); | 119 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); |
| 120 } | 120 } |
| 121 | 121 |
| 122 NewBrowserPageNavigator navigator_impl(profile_to_use); | 122 NewBrowserPageNavigator navigator_impl(profile_to_use); |
| 123 | 123 |
| 124 // TODO(robertshield): FTB - Switch this to HOST_DESKTOP_TYPE_ASH when | 124 // TODO(robertshield): FTB - Switch this to HOST_DESKTOP_TYPE_ASH when |
| 125 // we make that the default for metro. | 125 // we make that the default for metro. |
| 126 Browser* browser = | 126 Browser* browser = |
| 127 browser::FindTabbedBrowser(profile_to_use, | 127 chrome::FindTabbedBrowser(profile_to_use, |
| 128 false, | 128 false, |
| 129 chrome::HOST_DESKTOP_TYPE_NATIVE); | 129 chrome::HOST_DESKTOP_TYPE_NATIVE); |
| 130 content::PageNavigator* navigator = NULL; | 130 content::PageNavigator* navigator = NULL; |
| 131 if (!browser || !chrome::GetActiveWebContents(browser)) { | 131 if (!browser || !chrome::GetActiveWebContents(browser)) { |
| 132 navigator = &navigator_impl; | 132 navigator = &navigator_impl; |
| 133 } else { | 133 } else { |
| 134 browser->window()->Activate(); | 134 browser->window()->Activate(); |
| 135 navigator = chrome::GetActiveWebContents(browser); | 135 navigator = chrome::GetActiveWebContents(browser); |
| 136 } | 136 } |
| 137 | 137 |
| 138 chrome::OpenAll(parent_widget()->GetNativeWindow(), navigator, | 138 chrome::OpenAll(parent_widget()->GetNativeWindow(), navigator, |
| 139 selection(), NEW_FOREGROUND_TAB, profile_to_use); | 139 selection(), NEW_FOREGROUND_TAB, profile_to_use); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 156 if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW && | 156 if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW && |
| 157 !profile()->IsOffTheRecord()) { | 157 !profile()->IsOffTheRecord()) { |
| 158 return false; | 158 return false; |
| 159 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO && | 159 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO && |
| 160 profile()->IsOffTheRecord()) { | 160 profile()->IsOffTheRecord()) { |
| 161 return false; | 161 return false; |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 return BookmarkContextMenuControllerViews::IsCommandEnabled(id); | 164 return BookmarkContextMenuControllerViews::IsCommandEnabled(id); |
| 165 } | 165 } |
| OLD | NEW |