| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "win8/test/open_with_dialog_controller.h" | 5 #include "win8/test/open_with_dialog_controller.h" |
| 6 | 6 |
| 7 #include <shlobj.h> | 7 #include <shlobj.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Ignore any future callbacks (such as the timeout) or calls to Orphan. | 160 // Ignore any future callbacks (such as the timeout) or calls to Orphan. |
| 161 weak_ptr_factory_.InvalidateWeakPtrs(); | 161 weak_ptr_factory_.InvalidateWeakPtrs(); |
| 162 callback_.Run(automation_result_, automation_choices_); | 162 callback_.Run(automation_result_, automation_choices_); |
| 163 delete this; | 163 delete this; |
| 164 } | 164 } |
| 165 | 165 |
| 166 void OpenWithDialogController::Context::OnTimeout() { | 166 void OpenWithDialogController::Context::OnTimeout() { |
| 167 DCHECK(thread_checker_.CalledOnValidThread()); | 167 DCHECK(thread_checker_.CalledOnValidThread()); |
| 168 // This is a LOG rather than a DLOG since it represents something that needs | 168 // This is a LOG rather than a DLOG since it represents something that needs |
| 169 // to be investigated and fixed. | 169 // to be investigated and fixed. |
| 170 LOG(ERROR) << __FUNCTION__ " state: " << state_; | 170 LOG(ERROR) << __FUNCTION__ << " state: " << state_; |
| 171 | 171 |
| 172 state_ = CONTEXT_FINISHED; | 172 state_ = CONTEXT_FINISHED; |
| 173 NotifyClientAndDie(); | 173 NotifyClientAndDie(); |
| 174 } | 174 } |
| 175 | 175 |
| 176 void OpenWithDialogController::Context::OnInitialized(HRESULT result) { | 176 void OpenWithDialogController::Context::OnInitialized(HRESULT result) { |
| 177 DCHECK(thread_checker_.CalledOnValidThread()); | 177 DCHECK(thread_checker_.CalledOnValidThread()); |
| 178 DCHECK_EQ(state_, CONTEXT_INITIALIZED); | 178 DCHECK_EQ(state_, CONTEXT_INITIALIZED); |
| 179 if (FAILED(result)) { | 179 if (FAILED(result)) { |
| 180 automation_result_ = result; | 180 automation_result_ = result; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 base::Bind(&OpenWithDialogController::Begin, base::Unretained(this), | 283 base::Bind(&OpenWithDialogController::Begin, base::Unretained(this), |
| 284 parent_window, protocol, program, | 284 parent_window, protocol, program, |
| 285 Bind(&OnMakeDefaultComplete, run_loop.QuitClosure(), | 285 Bind(&OnMakeDefaultComplete, run_loop.QuitClosure(), |
| 286 &result, choices))); | 286 &result, choices))); |
| 287 | 287 |
| 288 run_loop.Run(); | 288 run_loop.Run(); |
| 289 return result; | 289 return result; |
| 290 } | 290 } |
| 291 | 291 |
| 292 } // namespace win8 | 292 } // namespace win8 |
| OLD | NEW |