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

Unified Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 1659203002: Remove HostDesktopType from FindLastActive[WithProfile] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nullptr Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/printing/print_error_dialog.cc ('k') | chrome/browser/safe_browsing/srt_fetcher_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 0b79bda117b22666dedcc133fa91b5a7d6f07d40..013d1bfae3016865326d6a3a618b05b4c55198b8 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -425,13 +425,12 @@ void AddIconToLastMenuItem(gfx::Image icon, ui::SimpleMenuModel* menu) {
}
#endif // !defined(OS_CHROMEOS)
-void OnProfileCreated(chrome::HostDesktopType desktop_type,
- const GURL& link_url,
+void OnProfileCreated(const GURL& link_url,
const content::Referrer& referrer,
Profile* profile,
Profile::CreateStatus status) {
if (status == Profile::CREATE_STATUS_INITIALIZED) {
- Browser* browser = chrome::FindLastActiveWithProfile(profile, desktop_type);
+ Browser* browser = chrome::FindLastActiveWithProfile(profile);
chrome::NavigateParams nav_params(browser, link_url,
ui::PAGE_TRANSITION_LINK);
nav_params.disposition = NEW_FOREGROUND_TAB;
@@ -898,9 +897,6 @@ void RenderViewContextMenu::AppendLinkItems() {
ProfileManager* profile_manager = g_browser_process->profile_manager();
const ProfileInfoCache& profile_info_cache =
profile_manager->GetProfileInfoCache();
- chrome::HostDesktopType desktop_type =
- chrome::GetHostDesktopTypeForNativeView(
- source_web_contents_->GetNativeView());
// Find all regular profiles other than the current one which have at
// least one open window.
@@ -915,7 +911,7 @@ void RenderViewContextMenu::AppendLinkItems() {
!profile_info_cache.IsOmittedProfileAtIndex(profile_index) &&
!profile_info_cache.ProfileIsSigninRequiredAtIndex(profile_index)) {
target_profiles.push_back(profile_index);
- if (chrome::FindLastActiveWithProfile(profile, desktop_type))
+ if (chrome::FindLastActiveWithProfile(profile))
multiple_profiles_open_ = true;
}
}
@@ -1668,7 +1664,7 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
Profile* profile = profile_manager->GetProfileByPath(profile_path);
UmaEnumOpenLinkAsUser profile_state;
- if (chrome::FindLastActiveWithProfile(profile, desktop_type)) {
+ if (chrome::FindLastActiveWithProfile(profile)) {
profile_state = OPEN_LINK_AS_USER_ACTIVE_PROFILE_ENUM_ID;
} else if (multiple_profiles_open_) {
profile_state =
@@ -1682,7 +1678,7 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
profiles::SwitchToProfile(
profile_path, desktop_type, false,
- base::Bind(OnProfileCreated, desktop_type, params_.link_url,
+ base::Bind(OnProfileCreated, params_.link_url,
CreateReferrer(params_.link_url, params_)),
ProfileMetrics::SWITCH_PROFILE_CONTEXT_MENU);
return;
« no previous file with comments | « chrome/browser/printing/print_error_dialog.cc ('k') | chrome/browser/safe_browsing/srt_fetcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698