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

Side by Side Diff: chrome/browser/ui/views/select_file_dialog_extension.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, 10 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
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/select_file_dialog_extension.h" 5 #include "chrome/browser/ui/views/select_file_dialog_extension.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 } 116 }
117 } 117 }
118 118
119 if (app_window) { 119 if (app_window) {
120 DCHECK(!app_window->window_type_is_panel()); 120 DCHECK(!app_window->window_type_is_panel());
121 *base_window = app_window->GetBaseWindow(); 121 *base_window = app_window->GetBaseWindow();
122 *web_contents = app_window->web_contents(); 122 *web_contents = app_window->web_contents();
123 } else { 123 } else {
124 // If the owning window is still unknown, this could be a background page or 124 // If the owning window is still unknown, this could be a background page or
125 // and extension popup. Use the last active browser. 125 // and extension popup. Use the last active browser.
126 if (!owner_browser) { 126 if (!owner_browser)
127 owner_browser = 127 owner_browser = chrome::FindLastActive();
128 chrome::FindLastActiveWithHostDesktopType(chrome::GetActiveDesktop());
129 }
130 if (owner_browser) { 128 if (owner_browser) {
131 *base_window = owner_browser->window(); 129 *base_window = owner_browser->window();
132 *web_contents = owner_browser->tab_strip_model()->GetActiveWebContents(); 130 *web_contents = owner_browser->tab_strip_model()->GetActiveWebContents();
133 } 131 }
134 } 132 }
135 133
136 // In ChromeOS kiosk launch mode, we can still show file picker for 134 // In ChromeOS kiosk launch mode, we can still show file picker for
137 // certificate manager dialog. There are no browser or webapp window 135 // certificate manager dialog. There are no browser or webapp window
138 // instances present in this case. 136 // instances present in this case.
139 if (chrome::IsRunningInForcedAppMode() && !(*web_contents)) 137 if (chrome::IsRunningInForcedAppMode() && !(*web_contents))
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 } 419 }
422 420
423 // Connect our listener to FileDialogFunction's per-tab callbacks. 421 // Connect our listener to FileDialogFunction's per-tab callbacks.
424 AddPending(routing_id); 422 AddPending(routing_id);
425 423
426 extension_dialog_ = dialog; 424 extension_dialog_ = dialog;
427 params_ = params; 425 params_ = params;
428 routing_id_ = routing_id; 426 routing_id_ = routing_id;
429 owner_window_ = owner_window; 427 owner_window_ = owner_window;
430 } 428 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/profiles/user_manager_view.cc ('k') | chrome/browser/ui/webui/signin/inline_login_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698