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

Side by Side Diff: ui/shell_dialogs/select_file_dialog_win.cc

Issue 37733003: Make GetRootWindow() return a Window instead of a RootWindow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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
« no previous file with comments | « ui/keyboard/keyboard_util.cc ('k') | ui/snapshot/snapshot_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/shell_dialogs/select_file_dialog_win.h" 5 #include "ui/shell_dialogs/select_file_dialog_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <commdlg.h> 8 #include <commdlg.h>
9 #include <shlobj.h> 9 #include <shlobj.h>
10 10
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 aura::HandleSelectFolder( 592 aura::HandleSelectFolder(
593 UTF16ToWide(title_string), 593 UTF16ToWide(title_string),
594 base::Bind(&ui::SelectFileDialog::Listener::FileSelected, 594 base::Bind(&ui::SelectFileDialog::Listener::FileSelected,
595 base::Unretained(listener_)), 595 base::Unretained(listener_)),
596 base::Bind(&ui::SelectFileDialog::Listener::FileSelectionCanceled, 596 base::Bind(&ui::SelectFileDialog::Listener::FileSelectionCanceled,
597 base::Unretained(listener_))); 597 base::Unretained(listener_)));
598 return; 598 return;
599 } 599 }
600 } 600 }
601 HWND owner = owning_window && owning_window->GetRootWindow() 601 HWND owner = owning_window && owning_window->GetRootWindow()
602 ? owning_window->GetRootWindow()->GetAcceleratedWidget() : NULL; 602 ? owning_window->GetDispatcher()->GetAcceleratedWidget() : NULL;
603 #else 603 #else
604 HWND owner = owning_window; 604 HWND owner = owning_window;
605 #endif 605 #endif
606 ExecuteSelectParams execute_params(type, UTF16ToWide(title), default_path, 606 ExecuteSelectParams execute_params(type, UTF16ToWide(title), default_path,
607 file_types, file_type_index, 607 file_types, file_type_index,
608 default_extension, BeginRun(owner), 608 default_extension, BeginRun(owner),
609 owner, params); 609 owner, params);
610 execute_params.run_state.dialog_thread->message_loop()->PostTask( 610 execute_params.run_state.dialog_thread->message_loop()->PostTask(
611 FROM_HERE, 611 FROM_HERE,
612 base::Bind(&SelectFileDialogImpl::ExecuteSelectFile, this, 612 base::Bind(&SelectFileDialogImpl::ExecuteSelectFile, this,
613 execute_params)); 613 execute_params));
614 } 614 }
615 615
616 bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() { 616 bool SelectFileDialogImpl::HasMultipleFileTypeChoicesImpl() {
617 return has_multiple_file_type_choices_; 617 return has_multiple_file_type_choices_;
618 } 618 }
619 619
620 bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow owning_window) const { 620 bool SelectFileDialogImpl::IsRunning(gfx::NativeWindow owning_window) const {
621 #if defined(USE_AURA) 621 #if defined(USE_AURA)
622 if (!owning_window->GetRootWindow()) 622 if (!owning_window->GetRootWindow())
623 return false; 623 return false;
624 HWND owner = owning_window->GetRootWindow()->GetAcceleratedWidget(); 624 HWND owner = owning_window->GetDispatcher()->GetAcceleratedWidget();
625 #else 625 #else
626 HWND owner = owning_window; 626 HWND owner = owning_window;
627 #endif 627 #endif
628 return listener_ && IsRunningDialogForOwner(owner); 628 return listener_ && IsRunningDialogForOwner(owner);
629 } 629 }
630 630
631 void SelectFileDialogImpl::ListenerDestroyed() { 631 void SelectFileDialogImpl::ListenerDestroyed() {
632 // Our associated listener has gone away, so we shouldn't call back to it if 632 // Our associated listener has gone away, so we shouldn't call back to it if
633 // our worker thread returns after the listener is dead. 633 // our worker thread returns after the listener is dead.
634 listener_ = NULL; 634 listener_ = NULL;
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
944 return return_value; 944 return return_value;
945 } 945 }
946 946
947 SelectFileDialog* CreateWinSelectFileDialog( 947 SelectFileDialog* CreateWinSelectFileDialog(
948 SelectFileDialog::Listener* listener, 948 SelectFileDialog::Listener* listener,
949 SelectFilePolicy* policy) { 949 SelectFilePolicy* policy) {
950 return new SelectFileDialogImpl(listener, policy); 950 return new SelectFileDialogImpl(listener, policy);
951 } 951 }
952 952
953 } // namespace ui 953 } // namespace ui
OLDNEW
« no previous file with comments | « ui/keyboard/keyboard_util.cc ('k') | ui/snapshot/snapshot_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698