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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); | 139 selection(), NEW_FOREGROUND_TAB, profile_to_use); |
140 bookmark_utils::RecordBookmarkLaunch( | 140 bookmark_utils::RecordBookmarkLaunch( |
141 bookmark_utils::LAUNCH_CONTEXT_MENU); | 141 bookmark_utils::LAUNCH_CONTEXT_MENU); |
142 return; | 142 return; |
143 } | 143 } |
144 | 144 |
145 default: | 145 default: |
146 break; | 146 break; |
147 } | 147 } |
148 } | 148 } |
149 BookmarkContextMenuControllerViews::ExecuteCommand(id); | 149 BookmarkContextMenuControllerViews::ExecuteCommand(id); |
150 } | 150 } |
151 | 151 |
152 bool BookmarkContextMenuControllerViewsWin::IsCommandEnabled(int id) const { | 152 bool BookmarkContextMenuControllerViewsWin::IsCommandEnabled(int id) const { |
153 // In Windows 8 metro mode no new window option on a regular chrome window | 153 // In Windows 8 metro mode no new window option on a regular chrome window |
154 // and no new incognito window option on an incognito chrome window. | 154 // and no new incognito window option on an incognito chrome window. |
155 if (win8::IsSingleWindowMetroMode()) { | 155 if (win8::IsSingleWindowMetroMode()) { |
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 |