diff options
5 files changed, 36 insertions, 4 deletions
diff --git a/chrome/browser/chromeos/login/login_html_dialog.cc b/chrome/browser/chromeos/login/login_html_dialog.cc index 0bf245f..d751a5c 100644 --- a/chrome/browser/chromeos/login/login_html_dialog.cc +++ b/chrome/browser/chromeos/login/login_html_dialog.cc @@ -93,6 +93,10 @@ void LoginHtmlDialog::SetDialogSize(int width, int height) { height_ = height; } +void LoginHtmlDialog::SetDialogTitle(const string16& title) { + title_ = title; +} + /////////////////////////////////////////////////////////////////////////////// // LoginHtmlDialog, protected: diff --git a/chrome/browser/chromeos/login/login_html_dialog.h b/chrome/browser/chromeos/login/login_html_dialog.h index a3a7012..c0bea3f 100644 --- a/chrome/browser/chromeos/login/login_html_dialog.h +++ b/chrome/browser/chromeos/login/login_html_dialog.h @@ -50,6 +50,9 @@ class LoginHtmlDialog : public HtmlDialogUIDelegate, // Overrides default width/height for dialog. void SetDialogSize(int width, int height); + // Overrides dialog title. + void SetDialogTitle(const string16& title); + void set_url(const GURL& url) { url_ = url; } bool is_open() const { return is_open_; } diff --git a/chrome/browser/chromeos/login/proxy_settings_dialog.cc b/chrome/browser/chromeos/login/proxy_settings_dialog.cc index 2a5a799..6af5537 100644 --- a/chrome/browser/chromeos/login/proxy_settings_dialog.cc +++ b/chrome/browser/chromeos/login/proxy_settings_dialog.cc @@ -1,21 +1,27 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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 "chrome/browser/chromeos/login/proxy_settings_dialog.h" +#include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/login/helper.h" +#include "chrome/browser/chromeos/proxy_config_service_impl.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/url_constants.h" #include "chrome/common/chrome_notification_types.h" #include "content/public/browser/notification_service.h" +#include "grit/generated_resources.h" +#include "ui/base/l10n/l10n_util.h" #include "ui/gfx/rect.h" #include "ui/gfx/size.h" namespace { // Hints for size of proxy settings dialog. -const int kProxySettingsDialogReasonableWidth = 750; -const int kProxySettingsDialogReasonableHeight = 550; +const int kProxySettingsDialogReasonableWidth = 626; +const int kProxySettingsDialogReasonableHeight = 525; const float kProxySettingsDialogReasonableWidthRatio = 0.4f; const float kProxySettingsDialogReasonableHeightRatio = 0.4f; @@ -44,6 +50,15 @@ ProxySettingsDialog::ProxySettingsDialog(LoginHtmlDialog::Delegate* delegate, CalculateSize(screen_bounds.height(), kProxySettingsDialogReasonableHeight, kProxySettingsDialogReasonableHeightRatio)); + + // Get network name for dialog title. + Profile* profile = ProfileManager::GetDefaultProfile(); + PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker(); + proxy_tracker->UIMakeActiveNetworkCurrent(); + std::string network_name; + proxy_tracker->UIGetCurrentNetworkName(&network_name); + SetDialogTitle(l10n_util::GetStringFUTF16(IDS_PROXY_PAGE_TITLE_FORMAT, + ASCIIToUTF16(network_name))); } void ProxySettingsDialog::OnDialogClosed(const std::string& json_retval) { diff --git a/chrome/browser/resources/chromeos/proxy_settings.css b/chrome/browser/resources/chromeos/proxy_settings.css index 5b7849d..8537de5 100644 --- a/chrome/browser/resources/chromeos/proxy_settings.css +++ b/chrome/browser/resources/chromeos/proxy_settings.css @@ -14,3 +14,8 @@ body { #proxyPage { height: 100%; } + +#proxy-page-title { + /* We have a title on the window, so the title in domui should be hidden. */ + display: none; +} diff --git a/chrome/browser/resources/chromeos/proxy_settings.html b/chrome/browser/resources/chromeos/proxy_settings.html index aa9762d..6c67023 100644 --- a/chrome/browser/resources/chromeos/proxy_settings.html +++ b/chrome/browser/resources/chromeos/proxy_settings.html @@ -2,9 +2,12 @@ <html i18n-values="dir:textdirection"> <head> <link rel="stylesheet" href="chrome://resources/css/button.css"> +<link rel="stylesheet" href="chrome://resources/css/checkbox.css"> <link rel="stylesheet" href="chrome://resources/css/list.css"> <link rel="stylesheet" href="chrome://resources/css/select.css"> +<link rel="stylesheet" href="chrome://resources/css/chrome_shared.css"> <link rel="stylesheet" href="../options/options_page.css"> +<link rel="stylesheet" href="../options/chromeos/internet_options_page.css"> <link rel="stylesheet" href="../options/chromeos/proxy.css"> <link rel="stylesheet" href="proxy_settings.css"> @@ -27,7 +30,9 @@ <script src="proxy_settings.js"></script> </head> -<body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize"> +<!-- We do not override the fontSize because it is defined in + internet_options_page.css. --> +<body i18n-values=".style.fontFamily:fontfamily"> <include src="../options/chromeos/proxy.html"> </body> </html> |