Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3395)

Unified Diff: chrome/browser/chromeos/login/proxy_settings_dialog.cc

Issue 4324001: Add proxy settings to network control at upper row of controls at login screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/proxy_settings_dialog.cc
diff --git a/chrome/browser/chromeos/login/proxy_settings_dialog.cc b/chrome/browser/chromeos/login/proxy_settings_dialog.cc
new file mode 100644
index 0000000000000000000000000000000000000000..69dc9c5493010989cd85109d1e167c52fdbdc7ad
--- /dev/null
+++ b/chrome/browser/chromeos/login/proxy_settings_dialog.cc
@@ -0,0 +1,48 @@
+// Copyright (c) 2010 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 "chrome/browser/chromeos/login/helper.h"
+#include "gfx/rect.h"
+#include "gfx/size.h"
+
+namespace {
+
+// Hints for size of proxy settings dialog.
+const int kProxySettingsDialogReasonableWidth = 750;
+const int kProxySettingsDialogReasonableHeight = 460;
+const float kProxySettingsDialogReasonableWidthRatio = 0.4f;
+const float kProxySettingsDialogReasonableHeightRatio = 0.4f;
+
+const char kProxySettingsURL[] = "chrome://settings/proxy?menu=off";
+
+int calculate_size(int screen_size, int min_comfortable, float desired_ratio) {
+ int desired_size = static_cast<int>(desired_ratio * screen_size);
+ desired_size = std::max(min_comfortable, desired_size);
+ return std::min(screen_size, desired_size);
+}
+
+} // namespace
+
+namespace chromeos {
+
+ProxySettingsDialog::ProxySettingsDialog(LoginHtmlDialog::Delegate* delegate,
+ gfx::NativeWindow window)
+ : LoginHtmlDialog(
+ delegate,
+ window,
+ std::wstring(),
+ GURL(kProxySettingsURL),
+ LoginHtmlDialog::STYLE_BUBBLE) {
+ gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size()));
+ SetDialogSize(calculate_size(screen_bounds.width(),
+ kProxySettingsDialogReasonableWidth,
+ kProxySettingsDialogReasonableWidthRatio),
+ calculate_size(screen_bounds.height(),
+ kProxySettingsDialogReasonableHeight,
+ kProxySettingsDialogReasonableHeightRatio));
+}
+
+} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/login/proxy_settings_dialog.h ('k') | chrome/browser/chromeos/status/network_dropdown_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698