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

Side by Side Diff: chrome/browser/ui/views/select_file_dialog_extension.cc

Issue 10825240: Refactor ShellWindow to separate platform-specific code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 8 years, 4 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/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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 // window. 275 // window.
276 std::vector<Profile*> profiles = 276 std::vector<Profile*> profiles =
277 g_browser_process->profile_manager()->GetLoadedProfiles(); 277 g_browser_process->profile_manager()->GetLoadedProfiles();
278 for (std::vector<Profile*>::const_iterator i(profiles.begin()); 278 for (std::vector<Profile*>::const_iterator i(profiles.begin());
279 i < profiles.end(); ++i) { 279 i < profiles.end(); ++i) {
280 ShellWindowRegistry* registry = ShellWindowRegistry::Get(*i); 280 ShellWindowRegistry* registry = ShellWindowRegistry::Get(*i);
281 DCHECK(registry); 281 DCHECK(registry);
282 ShellWindow* shell_window = registry->GetShellWindowForNativeWindow( 282 ShellWindow* shell_window = registry->GetShellWindowForNativeWindow(
283 owner_window); 283 owner_window);
284 if (shell_window) { 284 if (shell_window) {
285 base_window = shell_window; 285 base_window = shell_window->GetBaseWindow();
286 tab = shell_window->tab_contents(); 286 tab = shell_window->tab_contents();
287 profile_ = *i; 287 profile_ = *i;
288 break; 288 break;
289 } 289 }
290 } 290 }
291 } 291 }
292 292
293 if (!base_window) { 293 if (!base_window) {
294 NOTREACHED() << "Can't find owning window."; 294 NOTREACHED() << "Can't find owning window.";
295 return; 295 return;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 kFileManagerMinimumHeight); 340 kFileManagerMinimumHeight);
341 341
342 // Connect our listener to FileDialogFunction's per-tab callbacks. 342 // Connect our listener to FileDialogFunction's per-tab callbacks.
343 AddPending(tab_id); 343 AddPending(tab_id);
344 344
345 extension_dialog_ = dialog; 345 extension_dialog_ = dialog;
346 params_ = params; 346 params_ = params;
347 tab_id_ = tab_id; 347 tab_id_ = tab_id;
348 owner_window_ = owner_window; 348 owner_window_ = owner_window;
349 } 349 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698