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 "base/win/metro.h" | 7 #include "base/win/metro.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/bookmarks/bookmark_utils.h" | 9 #include "chrome/browser/bookmarks/bookmark_utils.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); | 110 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllInNewWindow")); |
111 } else { | 111 } else { |
112 if (!profile_to_use->IsOffTheRecord()) | 112 if (!profile_to_use->IsOffTheRecord()) |
113 profile_to_use = profile_to_use->GetOffTheRecordProfile(); | 113 profile_to_use = profile_to_use->GetOffTheRecordProfile(); |
114 | 114 |
115 content::RecordAction( | 115 content::RecordAction( |
116 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); | 116 UserMetricsAction("BookmarkBar_ContextMenu_OpenAllIncognito")); |
117 } | 117 } |
118 | 118 |
119 NewBrowserPageNavigator navigator_impl(profile_to_use); | 119 NewBrowserPageNavigator navigator_impl(profile_to_use); |
120 Browser* browser = browser::FindTabbedBrowser(profile_to_use, false); | 120 |
| 121 // TODO(robertshield): FTB - Switch this to HOST_DESKTOP_TYPE_ASH when |
| 122 // we make that the default for metro. |
| 123 Browser* browser = |
| 124 browser::FindTabbedBrowser(profile_to_use, |
| 125 false, |
| 126 chrome::HOST_DESKTOP_TYPE_NATIVE); |
121 content::PageNavigator* navigator = NULL; | 127 content::PageNavigator* navigator = NULL; |
122 if (!browser || !chrome::GetActiveWebContents(browser)) { | 128 if (!browser || !chrome::GetActiveWebContents(browser)) { |
123 navigator = &navigator_impl; | 129 navigator = &navigator_impl; |
124 } else { | 130 } else { |
125 browser->window()->Activate(); | 131 browser->window()->Activate(); |
126 navigator = chrome::GetActiveWebContents(browser); | 132 navigator = chrome::GetActiveWebContents(browser); |
127 } | 133 } |
128 | 134 |
129 bookmark_utils::OpenAll(parent_widget()->GetNativeWindow(), navigator, | 135 bookmark_utils::OpenAll(parent_widget()->GetNativeWindow(), navigator, |
130 selection(), NEW_FOREGROUND_TAB); | 136 selection(), NEW_FOREGROUND_TAB); |
(...skipping 16 matching lines...) Expand all Loading... |
147 if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW && | 153 if (id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW && |
148 !profile()->IsOffTheRecord()) { | 154 !profile()->IsOffTheRecord()) { |
149 return false; | 155 return false; |
150 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO && | 156 } else if (id == IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO && |
151 profile()->IsOffTheRecord()) { | 157 profile()->IsOffTheRecord()) { |
152 return false; | 158 return false; |
153 } | 159 } |
154 } | 160 } |
155 return BookmarkContextMenuControllerViews::IsCommandEnabled(id); | 161 return BookmarkContextMenuControllerViews::IsCommandEnabled(id); |
156 } | 162 } |
OLD | NEW |