summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-11 23:58:20 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-11 23:58:20 +0000
commit831c6bc95daf7f2e3966c168ecafb340e930d390 (patch)
tree10a11d3f5e36ce34a258609b2144a5d83a2719b7
parentce907ed1df759217baaae4ae1d008c202b5e4dd2 (diff)
downloadchromium_src-831c6bc95daf7f2e3966c168ecafb340e930d390.zip
chromium_src-831c6bc95daf7f2e3966c168ecafb340e930d390.tar.gz
chromium_src-831c6bc95daf7f2e3966c168ecafb340e930d390.tar.bz2
Remove Linux host setup wizard and libwebkitgtk dependency.
Review URL: https://codereview.chromium.org/11530020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172460 0039d316-1c4b-4281-b951-d872f2087c98
-rwxr-xr-xbuild/install-build-deps.sh14
-rw-r--r--remoting/host/setup/linux/linux_host_setup_wizard.cc308
-rw-r--r--remoting/remoting.gyp25
-rw-r--r--remoting/resources/string_resources.grd4
4 files changed, 7 insertions, 344 deletions
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh
index 730c0d1..f7a9cec 100755
--- a/build/install-build-deps.sh
+++ b/build/install-build-deps.sh
@@ -64,13 +64,13 @@ dev_list="apache2.2-bin bison curl elfutils fakeroot flex g++ gperf
language-pack-fr libapache2-mod-php5 libasound2-dev libbz2-dev
libcairo2-dev libcups2-dev libcurl4-gnutls-dev libelf-dev
libgconf2-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev
- libgnome-keyring-dev libgtk2.0-dev libwebkit-dev libkrb5-dev
- libnspr4-dev libnss3-dev libpam0g-dev libpci-dev libsctp-dev
- libspeechd-dev libsqlite3-dev libssl-dev libudev-dev libwww-perl
- libxslt1-dev libxss-dev libxt-dev libxtst-dev mesa-common-dev patch
- perl php5-cgi pkg-config python python-cherrypy3 python-dev
- python-psutil rpm ruby subversion ttf-dejavu-core ttf-indic-fonts
- ttf-kochi-gothic ttf-kochi-mincho ttf-thai-tlwg wdiff git-core
+ libgnome-keyring-dev libgtk2.0-dev libkrb5-dev libnspr4-dev
+ libnss3-dev libpam0g-dev libpci-dev libsctp-dev libspeechd-dev
+ libsqlite3-dev libssl-dev libudev-dev libwww-perl libxslt1-dev
+ libxss-dev libxt-dev libxtst-dev mesa-common-dev patch perl php5-cgi
+ pkg-config python python-cherrypy3 python-dev python-psutil rpm ruby
+ subversion ttf-dejavu-core ttf-indic-fonts ttf-kochi-gothic
+ ttf-kochi-mincho ttf-thai-tlwg wdiff git-core
$chromeos_dev_list"
# 64-bit systems need a minimum set of 32-bit compat packages for the pre-built
diff --git a/remoting/host/setup/linux/linux_host_setup_wizard.cc b/remoting/host/setup/linux/linux_host_setup_wizard.cc
deleted file mode 100644
index 98dde3b..0000000
--- a/remoting/host/setup/linux/linux_host_setup_wizard.cc
+++ /dev/null
@@ -1,308 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-#include <webkit/webkitwebview.h>
-
-#include "base/at_exit.h"
-#include "base/basictypes.h"
-#include "base/command_line.h"
-#include "base/message_loop.h"
-#include "base/run_loop.h"
-#include "base/threading/thread.h"
-#include "net/base/net_util.h"
-#include "remoting/base/common_resources.h"
-#include "remoting/base/resources.h"
-#include "remoting/base/string_resources.h"
-#include "remoting/host/setup/host_starter.h"
-#include "remoting/host/setup/oauth_helper.h"
-#include "remoting/host/setup/pin_validator.h"
-#include "remoting/host/url_request_context.h"
-#include "ui/base/gtk/gtk_signal.h"
-#include "ui/base/gtk/scoped_gobject.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/resource/resource_bundle.h"
-#include "ui/base/ui_base_paths.h"
-
-namespace remoting {
-
-class LinuxHostSetupWizard {
- public:
- enum Pages {
- kAuthPage = 0,
- kPinPage = 1,
- kProgressPage = 2,
- kStartedPage = 3,
- kErrorPage = 4,
- kStoppedPage = 5,
- };
-
- LinuxHostSetupWizard();
- ~LinuxHostSetupWizard();
-
- void Init();
- void Run();
-
- private:
- CHROMEGTK_CALLBACK_1(LinuxHostSetupWizard, gboolean, OnDelete, GdkEvent*);
- CHROMEGTK_CALLBACK_1(LinuxHostSetupWizard, void, OnAuthUriChanged,
- GParamSpec*);
- CHROMEGTK_CALLBACK_0(LinuxHostSetupWizard, void, OnPinOkClicked);
-
- GtkWidget* AddPage(int expected_index);
- GtkWidget* AddTextFieldWithLabel(GtkContainer* container,
- const std::string& message);
- void AddButtonsBox(GtkContainer* container, GCallback ok_callback);
-
- void ShowAuthenticationPrompt();
- void ShowProgressMessage(const std::string& message);
- void ShowErrorMessage(const std::string& message);
-
- void ShowMessageBox(const std::string& message);
-
- void OnHostStarted(HostStarter::Result result);
-
- MessageLoopForUI main_message_loop_;
- base::RunLoop run_loop_;
-
- scoped_ptr<base::Thread> io_thread_;
-
- scoped_refptr<URLRequestContextGetter> url_context_getter_;
-
- GtkWidget* main_window_;
- GtkWidget* notebook_;
-
- // TODO(sergeyu): Replace auth code with authentication.
- GtkWidget* auth_web_view_;
- GtkWidget* pin_entry_;
- GtkWidget* pin_repeat_entry_;
- GtkWidget* progress_message_;
- GtkWidget* error_message_;
-
- std::string auth_code_;
-
- scoped_ptr<HostStarter> starter_;
-
- DISALLOW_COPY_AND_ASSIGN(LinuxHostSetupWizard);
-};
-
-LinuxHostSetupWizard::LinuxHostSetupWizard() {
-}
-
-LinuxHostSetupWizard::~LinuxHostSetupWizard() {
- gtk_widget_destroy(main_window_);
-}
-
-void LinuxHostSetupWizard::Init() {
- io_thread_.reset(new base::Thread("IOThread"));
- io_thread_->StartWithOptions(
- base::Thread::Options(MessageLoop::TYPE_IO, 0));
-
- url_context_getter_ = new URLRequestContextGetter(
- main_message_loop_.message_loop_proxy(),
- io_thread_->message_loop_proxy());
-
- main_window_ = gtk_window_new(GTK_WINDOW_TOPLEVEL);
- g_signal_connect(main_window_, "delete-event",
- G_CALLBACK(OnDeleteThunk), this);
- gtk_window_set_title(
- GTK_WINDOW(main_window_),
- l10n_util::GetStringUTF8(IDR_PRODUCT_NAME).c_str());
- gtk_window_set_resizable(GTK_WINDOW(main_window_), FALSE);
-
- gfx::Image logo = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
- IDR_PRODUCT_LOGO_32);
- ui::ScopedGObject<GdkPixbuf>::Type pixbuf(logo.ToGdkPixbuf());
- gtk_window_set_icon(GTK_WINDOW(main_window_), pixbuf.get());
-
- notebook_ = gtk_notebook_new();
- gtk_container_add(GTK_CONTAINER(main_window_), notebook_);
- gtk_notebook_set_show_tabs(GTK_NOTEBOOK(notebook_), FALSE);
- gtk_notebook_set_show_border(GTK_NOTEBOOK(notebook_), FALSE);
-
- GtkWidget* auth_page = AddPage(kAuthPage);
- auth_web_view_ = webkit_web_view_new();
- gtk_container_add(GTK_CONTAINER(auth_page), auth_web_view_);
- g_signal_connect(auth_web_view_, "notify::uri",
- G_CALLBACK(OnAuthUriChangedThunk), this);
-
- GtkWidget* pin_page = AddPage(kPinPage);
- pin_entry_ = AddTextFieldWithLabel(
- GTK_CONTAINER(pin_page),
- l10n_util::GetStringUTF8(IDR_ASK_PIN_DIALOG_LABEL));
- pin_repeat_entry_ = AddTextFieldWithLabel(
- GTK_CONTAINER(pin_page),
- l10n_util::GetStringUTF8(IDR_ASK_PIN_DIALOG_CONFIRM_LABEL));
- AddButtonsBox(GTK_CONTAINER(pin_page), G_CALLBACK(OnPinOkClickedThunk));
-
- GtkWidget* progress_page = AddPage(kProgressPage);
- progress_message_ = gtk_label_new("");
- gtk_container_add(GTK_CONTAINER(progress_page), progress_message_);
-
- GtkWidget* started_page = AddPage(kStartedPage);
- GtkWidget* started_message = gtk_label_new(
- l10n_util::GetStringUTF8(IDR_HOST_SETUP_STARTED).c_str());
- gtk_container_add(GTK_CONTAINER(started_page), started_message);
-
- GtkWidget* error_page = AddPage(kErrorPage);
- error_message_ = gtk_label_new("");
- gtk_container_add(GTK_CONTAINER(error_page), error_message_);
-
- GtkWidget* stopped_page = AddPage(kStoppedPage);
- GtkWidget* stopped_message = gtk_label_new(
- l10n_util::GetStringUTF8(IDR_HOST_NOT_STARTED).c_str());
- gtk_container_add(GTK_CONTAINER(stopped_page), stopped_message);
-
- gtk_widget_show_all(main_window_);
-
- ShowAuthenticationPrompt();
-}
-
-void LinuxHostSetupWizard::Run() {
- gtk_widget_show_all(main_window_);
- run_loop_.Run();
-}
-
-GtkWidget* LinuxHostSetupWizard::AddPage(int expected_index) {
- GtkWidget* page = gtk_vbox_new(FALSE, 8);
-
- int page_index =
- gtk_notebook_append_page(GTK_NOTEBOOK(notebook_), page, NULL);
- DCHECK_EQ(page_index, expected_index);
-
- return page;
-}
-
-GtkWidget* LinuxHostSetupWizard::AddTextFieldWithLabel(
- GtkContainer* container,
- const std::string& message) {
- GtkWidget* box = gtk_hbox_new(FALSE, 8);
- gtk_container_add(container, box);
-
- GtkWidget* label = gtk_label_new(message.c_str());
- gtk_container_add(GTK_CONTAINER(box), label);
-
- GtkWidget* entry = gtk_entry_new();
- gtk_container_add(GTK_CONTAINER(box), entry);
-
- return entry;
-}
-
-void LinuxHostSetupWizard::AddButtonsBox(GtkContainer* container,
- GCallback ok_callback) {
- GtkWidget* box = gtk_hbox_new(FALSE, 8);
- gtk_container_add(container, box);
-
- GtkWidget* button =
- gtk_button_new_with_label(l10n_util::GetStringUTF8(IDR_OK).c_str());
- gtk_container_add(GTK_CONTAINER(box), button);
- g_signal_connect(button, "clicked", ok_callback, this);
-}
-
-void LinuxHostSetupWizard::ShowAuthenticationPrompt() {
- std::string url = GetOauthStartUrl(GetDefaultOauthRedirectUrl());
- webkit_web_view_load_uri(WEBKIT_WEB_VIEW(auth_web_view_), url.c_str());
- gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook_), kAuthPage);
-}
-
-void LinuxHostSetupWizard::ShowProgressMessage(const std::string& message) {
- gtk_label_set_text(GTK_LABEL(progress_message_), message.c_str());
- gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook_), kProgressPage);
-}
-
-void LinuxHostSetupWizard::ShowErrorMessage(const std::string& message) {
- gtk_label_set_text(GTK_LABEL(error_message_), message.c_str());
- gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook_), kErrorPage);
-}
-
-void LinuxHostSetupWizard::ShowMessageBox(const std::string& message) {
- GtkWidget* dialog = gtk_message_dialog_new(
- GTK_WINDOW(main_window_), static_cast<GtkDialogFlags>(
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT),
- GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, "%s", message.c_str());
- g_signal_connect(dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);
- gtk_widget_show_all(dialog);
-}
-
-gboolean LinuxHostSetupWizard::OnDelete(GtkWidget* window, GdkEvent* event) {
- run_loop_.Quit();
- return TRUE;
-}
-
-void LinuxHostSetupWizard::OnAuthUriChanged(GtkWidget* web_view,
- GParamSpec* param_spec) {
- std::string url(webkit_web_view_get_uri(WEBKIT_WEB_VIEW(auth_web_view_)));
- std::string auth_code = GetOauthCodeInUrl(url, GetDefaultOauthRedirectUrl());
- if (!auth_code.empty()) {
- auth_code_ = auth_code;
- gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook_), kPinPage);
- }
-}
-
-void LinuxHostSetupWizard::OnPinOkClicked(GtkWidget* button) {
- std::string host_name = net::GetHostName();
- std::string pin = gtk_entry_get_text(GTK_ENTRY(pin_entry_));
- std::string pin_repeat = gtk_entry_get_text(GTK_ENTRY(pin_repeat_entry_));
-
- if (!IsPinValid(pin)) {
- ShowMessageBox(l10n_util::GetStringUTF8(IDR_INVALID_PIN));
- return;
- }
-
- if (pin != pin_repeat) {
- ShowMessageBox(l10n_util::GetStringUTF8(IDR_PINS_NOT_EQUAL));
- return;
- }
-
- starter_ = HostStarter::Create(url_context_getter_.get());
-
- starter_->StartHost(host_name, pin, false, auth_code_,
- GetDefaultOauthRedirectUrl(),
- base::Bind(&LinuxHostSetupWizard::OnHostStarted,
- base::Unretained(this)));
- ShowProgressMessage(l10n_util::GetStringUTF8(IDR_HOST_SETUP_STARTING));
-}
-
-void LinuxHostSetupWizard::OnHostStarted(HostStarter::Result result) {
- switch (result) {
- case HostStarter::START_COMPLETE:
- gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook_), kStartedPage);
- break;
-
- case HostStarter::NETWORK_ERROR:
- case HostStarter::OAUTH_ERROR:
- ShowErrorMessage(l10n_util::GetStringUTF8(
- IDR_HOST_SETUP_REGISTRATION_FAILED));
- break;
-
- case HostStarter::START_ERROR:
- ShowErrorMessage(l10n_util::GetStringUTF8(IDR_HOST_SETUP_HOST_FAILED));
- break;
- }
-}
-
-} // namespace remoting
-
-int main(int argc, char** argv) {
- CommandLine::Init(argc, argv);
- base::AtExitManager at_exit_manager;
- ui::RegisterPathProvider();
-
- remoting::LoadResources(std::string());
-
- InitLogging(NULL,
- logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
- logging::DONT_LOCK_LOG_FILE,
- logging::APPEND_TO_OLD_LOG_FILE,
- logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
-
- gtk_init(&argc, &argv);
-
- remoting::LinuxHostSetupWizard setup_ui;
- setup_ui.Init();
- setup_ui.Run();
-
- return 0;
-}
diff --git a/remoting/remoting.gyp b/remoting/remoting.gyp
index db9a678..7d891f9 100644
--- a/remoting/remoting.gyp
+++ b/remoting/remoting.gyp
@@ -862,30 +862,6 @@
'host/setup/start_host.cc',
],
}, # end of target 'remoting_start_host'
- {
- 'target_name': 'remoting_configurer',
- 'type': 'executable',
- 'variables': { 'enable_wexit_time_destructors': 1, },
- 'cflags': [
- '<!@(pkg-config --cflags webkit-1.0)',
- ],
- 'link_settings': {
- 'ldflags': [
- '<!@(pkg-config --libs-only-L --libs-only-other webkit-1.0)',
- ],
- 'libraries': [
- '<!@(pkg-config --libs-only-l webkit-1.0)',
- ],
- },
- 'dependencies': [
- '../base/base.gyp:base',
- 'remoting_host_setup_base',
- 'remoting_resources'
- ],
- 'sources': [
- 'host/setup/linux/linux_host_setup_wizard.cc',
- ],
- }, # end of target 'remoting_configurer'
], # end of 'targets'
}], # 'OS=="linux"'
@@ -1758,7 +1734,6 @@
'sources': [
'base/resources_unittest.cc',
'host/plugin/host_script_object.cc',
- 'host/setup/linux/linux_host_setup_wizard.cc',
'webapp/client_screen.js',
'webapp/host_list.js',
'webapp/host_table_entry.js',
diff --git a/remoting/resources/string_resources.grd b/remoting/resources/string_resources.grd
index e7d5e00..a60673b 100644
--- a/remoting/resources/string_resources.grd
+++ b/remoting/resources/string_resources.grd
@@ -513,10 +513,6 @@
<message desc="Help link displayed when the user enables the host on this computer. Clicking this link opens a page that explains why this operation is safe. This string appears in a UI with limited horizontal space. Please try to keep translations no more than about 30 characters." name="IDR_WHY_IS_THIS_SAFE">
Why is this safe?
</message>
-
- <message name="IDR_HOST_NOT_STARTED" desc="Message displayed when the current computer is not accepting remote connections, instructing the user how to enable them.">
- Remote access to this computer is disabled.
- </message>
</messages>
</release>
</grit>