Removed extra header files and made proper indent.
Removed unnecessary comments.
Updated copyright year in LICENSE file
Resolved all warnings
Change-Id: Ica52a53f219d4245003b1ccf2e2ca68ac00b8034
Signed-off-by: deepti <d.saraswat@samsung.com>
#include "atom/browser/atom_browser_context.h"
#include "atom/browser/atom_browser_main_parts.h"
#include "atom/browser/login_handler.h"
+#include "atom/browser/native_window_efl.h"
#include "atom/browser/relauncher.h"
#include "atom/common/atom_command_line.h"
#include "atom/common/native_mate_converters/callback.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/icon_manager.h"
#include "chrome/common/chrome_paths.h"
+#include "common/app_db.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/gpu_data_manager.h"
#include "native_mate/object_template_builder.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "tizen/common/env_variables.h"
+#include "tizen/src/browser/popup.h"
+#include "tizen/src/browser/popup_string.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image.h"
#include "base/strings/utf_string_conversions.h"
#endif
-#include "tizen/src/browser/popup.h"
-#include "tizen/src/browser/popup_string.h"
-#include "atom/browser/native_window_efl.h"
-
-#include "common/app_db.h"
using atom::Browser;
namespace {
const char* kCertificateAllowPrefix = "__WRT_CERTIPERM_";
- const char* kDbInitedCheckKey = "__WRT_DB_INITED__";
- const char* kDBPublicSection = "public";
const char* kDBPrivateSection = "private";
- const char* kReadOnlyPrefix = "_READONLY_KEY_";
} // namespace
bool expired_previous_decision,
const base::Callback<void(content::CertificateRequestResultType)>&
callback) {
- LOG(ERROR)<<__FUNCTION__;
if (!::tizen::is_single_process)
v8::Locker locker(isolate());
v8::HandleScope handle_scope(isolate());
ssl_info.cert,
callback);
- std::string pem_certificate;
- if (!net::X509Certificate::GetPEMEncoded(ssl_info.cert->os_cert_handle(), &pem_certificate)) {
- LOG(INFO) << "Certificate for URL: " << request_url.spec() << " could not be opened";
- callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL);
- return;
- }
-
- // Deny the certificate by default.
- /* if (!prevent_default)
+ if (!prevent_default) {
+ std::string pem_certificate;
+ if (!net::X509Certificate::GetPEMEncoded(ssl_info.cert->os_cert_handle(), &pem_certificate)) {
+ LOG(INFO) << "Certificate for URL: " << request_url.spec() << " could not be opened";
+ callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CANCEL);
+ return;
+ }
+ AllowCertificateDialog(web_contents, request_url.spec(), pem_certificate, callback);
+ } else {
callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY);
- else*/
- //callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE);
-
-
- AllowCertificateDialog(web_contents, request_url.spec(), pem_certificate, callback);
+ }
}
+
void App::AllowCertificateDialog(content::WebContents* web_contents,
const std::string& url,
const std::string& pem,
}
- Evas_Object* window = static_cast<atom::NativeWindowEfl*>(atom::NativeWindow::FromWebContents(web_contents))->evas_object();
+ Evas_Object* window = static_cast<atom::NativeWindowEfl*>(
+ atom::NativeWindow::FromWebContents(web_contents))->evas_object();
runtime::Popup* popup = runtime::Popup::CreatePopup(window);
popup->SetButtonType(runtime::Popup::ButtonType::AllowDenyButton);
popup->SetTitle(runtime::popup_string::kPopupTitleCert);
- popup->SetBody(runtime::popup_string::GetText(runtime::popup_string::kPopupBodyCert) + "\n\n" + url);
+ popup->SetBody(runtime::popup_string::GetText(runtime::popup_string::kPopupBodyCert)
+ + "\n\n" + url);
popup->SetCheckBox(runtime::popup_string::kPopupCheckRememberPreference);
popup->SetResultHandler(
[db, callback, pem](runtime::Popup* popup, void* /*user_data*/) {
- //[db, result_handler, pem](Popup* popup, void* /*user_data*/) {
bool result = popup->GetButtonResult();
bool remember = popup->GetCheckBoxResult();
if (remember) {
- LOG(ERROR)<<"pem: "<<pem;
- db->Set(kDBPrivateSection, kCertificateAllowPrefix + pem,
- result ? "allowed" : "denied");
-
+ db->Set(kDBPrivateSection, kCertificateAllowPrefix + pem,
+ result ? "allowed" : "denied");
}
if(result)
callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE);
bool expired_previous_decision,
const base::Callback<void(content::CertificateRequestResultType)>&
callback) override;
-void AllowCertificateDialog(content::WebContents* web_contents,
- const std::string& url,
- const std::string& pem,
- const base::Callback<void(content::CertificateRequestResultType)>&
- callback);
void SelectClientCertificate(
content::WebContents* web_contents,
net::SSLCertRequestInfo* cert_request_info,
void DisableHardwareAcceleration(mate::Arguments* args);
bool IsAccessibilitySupportEnabled();
Browser::LoginItemSettings GetLoginItemSettings(mate::Arguments* args);
+ void AllowCertificateDialog(content::WebContents* web_contents,
+ const std::string& url,
+ const std::string& pem,
+ const base::Callback<void(content::CertificateRequestResultType)>&
+ callback);
#if defined(USE_NSS_CERTS)
void ImportCertificate(const base::DictionaryValue& options,
const net::CompletionCallback& callback);
* limitations under the License.
*/
-//#include "tizen/common/constants.h"
#include "constants.h"
namespace runtime {
const char kAppDBRuntimeSection[] = "Runtime";
const char kAppDBRuntimeBundle[] = "encoded_bundle";
-const char kTextDomainRuntime[] = "xwalk";
+const char kTextDomainRuntime[] = "pwrt";
} // namespace runtime
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
-#include "tizen/src/browser/popup.h"
-
-//#include "common/logger.h"
#include "atom/browser/native_window.h"
-#include "tizen/src/browser/popup_string.h"
#include "tizen/common/constants.h"
+#include "tizen/src/browser/popup.h"
+#include "tizen/src/browser/popup_string.h"
namespace runtime {
namespace {
-const char* kWRTEdjePath = "/usr/share/edje/xwalk/xwalk_tizen.edj";
+const char* kWRTEdjePath = "/usr/share/edje/pwrt/pwrt_tizen.edj";
#ifdef MODEL_FORMFACTOR_CIRCLE
-const char* kWRTIconDeletePath = "/usr/share/icons/xwalk/tw_ic_popup_btn_delete.png";
-const char* kWRTIconCheckPath = "/usr/share/icons/xwalk/tw_ic_popup_btn_check.png";
+const char* kWRTIconDeletePath = "/usr/share/icons/pwrt/tw_ic_popup_btn_delete.png";
+const char* kWRTIconCheckPath = "/usr/share/icons/pwrt/tw_ic_popup_btn_check.png";
const char* kLayoutTheme = "content/circle/buttons2";
const char* kContentTitle = "elm.text.title";
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
-#ifndef XWALK_RUNTIME_BROWSER_POPUP_H_
-#define XWALK_RUNTIME_BROWSER_POPUP_H_
+#ifndef TIZEN_SRC_BROWSER_POPUP_H_
+#define TIZEN_SRC_BROWSER_POPUP_H_
#include <Elementary.h>
#include <Evas.h>
} // namespace runtime
-#endif // XWALK_RUNTIME_BROWSER_POPUP_H_
+#endif // TIZEN_SRC_BROWSER_POPUP_H_
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
*/
-#include "tizen/src/browser/popup_string.h"
#include <libintl.h>
-
#include "tizen/common/constants.h"
+#include "tizen/src/browser/popup_string.h"
namespace runtime {
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*/
-#ifndef XWALK_RUNTIME_BROWSER_POPUP_STRING_H_
-#define XWALK_RUNTIME_BROWSER_POPUP_STRING_H_
+#ifndef TIZEN_SRC_BROWSER_POPUP_STRING_H_
+#define TIZEN_SRC_BROWSER_POPUP_STRING_H_
#include <string>
} // namespace runtime
-#endif // XWALK_RUNTIME_BROWSER_POPUP_STRING_H_
+#endif // TIZEN_SRC_BROWSER_POPUP_STRING_H_
'tizen/src/app/wrt_main_delegate.h',
'tizen/src/browser/api/wrt_api_core.cc',
'tizen/src/browser/api/wrt_api_core.h',
+ 'tizen/src/browser/native_web_runtime.cc',
+ 'tizen/src/browser/native_web_runtime.h',
+ 'tizen/src/browser/native_web_runtime_observer.h',
'tizen/src/browser/popup.cc',
'tizen/src/browser/popup.h',
'tizen/src/browser/popup_string.cc',
'tizen/src/browser/popup_string.h',
- 'tizen/src/browser/native_web_runtime.cc',
- 'tizen/src/browser/native_web_runtime.h',
- 'tizen/src/browser/native_web_runtime_observer.h',
'tizen/src/browser/wrt_ipc.cc',
'tizen/src/browser/wrt_ipc.h',
'tizen/src/browser/wrt_service.cc',