OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ppapi/cpp/trusted/file_chooser_trusted.h" | 5 #include "ppapi/cpp/trusted/file_chooser_trusted.h" |
6 | 6 |
7 #include "ppapi/c/pp_bool.h" | 7 #include "ppapi/c/pp_bool.h" |
8 #include "ppapi/cpp/completion_callback.h" | 8 #include "ppapi/cpp/completion_callback.h" |
9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
10 #include "ppapi/cpp/module_impl.h" | 10 #include "ppapi/cpp/module_impl.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 save_as_(save_as), | 33 save_as_(save_as), |
34 suggested_file_name_(suggested_file_name) { | 34 suggested_file_name_(suggested_file_name) { |
35 } | 35 } |
36 | 36 |
37 FileChooser_Trusted::FileChooser_Trusted(const FileChooser_Trusted& other) | 37 FileChooser_Trusted::FileChooser_Trusted(const FileChooser_Trusted& other) |
38 : FileChooser_Dev(other), | 38 : FileChooser_Dev(other), |
39 save_as_(other.save_as_), | 39 save_as_(other.save_as_), |
40 suggested_file_name_(other.suggested_file_name_) { | 40 suggested_file_name_(other.suggested_file_name_) { |
41 } | 41 } |
42 | 42 |
| 43 FileChooser_Trusted& FileChooser_Trusted::operator=( |
| 44 const FileChooser_Trusted& other) { |
| 45 FileChooser_Dev::operator=(other); |
| 46 save_as_ = other.save_as_; |
| 47 suggested_file_name_ = other.suggested_file_name_; |
| 48 return *this; |
| 49 } |
| 50 |
43 int32_t FileChooser_Trusted::Show(const CompletionCallback& cc) { | 51 int32_t FileChooser_Trusted::Show(const CompletionCallback& cc) { |
44 if (!has_interface<PPB_FileChooserTrusted>()) | 52 if (!has_interface<PPB_FileChooserTrusted>()) |
45 return cc.MayForce(PP_ERROR_NOINTERFACE); | 53 return cc.MayForce(PP_ERROR_NOINTERFACE); |
46 return get_interface<PPB_FileChooserTrusted>()->ShowWithoutUserGesture( | 54 return get_interface<PPB_FileChooserTrusted>()->ShowWithoutUserGesture( |
47 pp_resource(), | 55 pp_resource(), |
48 PP_FromBool(save_as_), | 56 PP_FromBool(save_as_), |
49 Var(suggested_file_name_).pp_var(), | 57 Var(suggested_file_name_).pp_var(), |
50 cc.pp_completion_callback()); | 58 cc.pp_completion_callback()); |
51 } | 59 } |
52 | 60 |
53 } // namespace pp | 61 } // namespace pp |
OLD | NEW |