OLD | NEW |
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/webui/extensions/pack_extension_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/pack_extension_handler.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_creator.h" | 7 #include "chrome/browser/extensions/extension_creator.h" |
8 #include "chrome/browser/ui/chrome_select_file_policy.h" | 8 #include "chrome/browser/ui/chrome_select_file_policy.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 !args->GetString(1, &private_key_path_)) | 112 !args->GetString(1, &private_key_path_)) |
113 NOTREACHED(); | 113 NOTREACHED(); |
114 | 114 |
115 double flags_double = 0.0; | 115 double flags_double = 0.0; |
116 if (!args->GetDouble(2, &flags_double)) | 116 if (!args->GetDouble(2, &flags_double)) |
117 NOTREACHED(); | 117 NOTREACHED(); |
118 | 118 |
119 int run_flags = static_cast<int>(flags_double); | 119 int run_flags = static_cast<int>(flags_double); |
120 | 120 |
121 base::FilePath root_directory = | 121 base::FilePath root_directory = |
122 base::FilePath::FromWStringHack(UTF8ToWide(extension_path_)); | 122 base::FilePath::FromWStringHack(base::UTF8ToWide(extension_path_)); |
123 base::FilePath key_file = | 123 base::FilePath key_file = |
124 base::FilePath::FromWStringHack(UTF8ToWide(private_key_path_)); | 124 base::FilePath::FromWStringHack(base::UTF8ToWide(private_key_path_)); |
125 | 125 |
126 if (root_directory.empty()) { | 126 if (root_directory.empty()) { |
127 if (extension_path_.empty()) { | 127 if (extension_path_.empty()) { |
128 ShowAlert(l10n_util::GetStringUTF8( | 128 ShowAlert(l10n_util::GetStringUTF8( |
129 IDS_EXTENSION_PACK_DIALOG_ERROR_ROOT_REQUIRED)); | 129 IDS_EXTENSION_PACK_DIALOG_ERROR_ROOT_REQUIRED)); |
130 } else { | 130 } else { |
131 ShowAlert(l10n_util::GetStringUTF8( | 131 ShowAlert(l10n_util::GetStringUTF8( |
132 IDS_EXTENSION_PACK_DIALOG_ERROR_ROOT_INVALID)); | 132 IDS_EXTENSION_PACK_DIALOG_ERROR_ROOT_INVALID)); |
133 } | 133 } |
134 | 134 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 FILE_PATH_LITERAL(""), | 188 FILE_PATH_LITERAL(""), |
189 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), | 189 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), |
190 NULL); | 190 NULL); |
191 } | 191 } |
192 | 192 |
193 void PackExtensionHandler::ShowAlert(const std::string& message) { | 193 void PackExtensionHandler::ShowAlert(const std::string& message) { |
194 ListValue arguments; | 194 ListValue arguments; |
195 arguments.Append(Value::CreateStringValue(message)); | 195 arguments.Append(Value::CreateStringValue(message)); |
196 web_ui()->CallJavascriptFunction("PackExtensionOverlay.showError", arguments); | 196 web_ui()->CallJavascriptFunction("PackExtensionOverlay.showError", arguments); |
197 } | 197 } |
OLD | NEW |