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

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

Issue 11779019: browser: Move FindTabbedBrowser() function into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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 "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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator_impl.cc ('k') | chrome/browser/ui/views/frame/browser_frame_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698