Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_views_win.cc

Issue 10967003: Add desktop type context to most existing instances of FindTabbedBrowser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving check_deps exception to specific_include_rules after chat with Kai. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698