| 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/chromeos/login/proxy_settings_dialog.h" | 5 #include "chrome/browser/chromeos/login/proxy_settings_dialog.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/chromeos/login/helper.h" | 10 #include "chrome/browser/chromeos/login/helper.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 namespace chromeos { | 49 namespace chromeos { |
| 50 | 50 |
| 51 // static | 51 // static |
| 52 int ProxySettingsDialog::instance_count_ = 0; | 52 int ProxySettingsDialog::instance_count_ = 0; |
| 53 | 53 |
| 54 ProxySettingsDialog::ProxySettingsDialog(const NetworkState& network, | 54 ProxySettingsDialog::ProxySettingsDialog(const NetworkState& network, |
| 55 LoginWebDialog::Delegate* delegate, | 55 LoginWebDialog::Delegate* delegate, |
| 56 gfx::NativeWindow window) | 56 gfx::NativeWindow window) |
| 57 : LoginWebDialog(delegate, | 57 : LoginWebDialog(delegate, |
| 58 window, | 58 window, |
| 59 string16(), | 59 base::string16(), |
| 60 GetURLForProxySettings(network.path()), | 60 GetURLForProxySettings(network.path()), |
| 61 LoginWebDialog::STYLE_BUBBLE) { | 61 LoginWebDialog::STYLE_BUBBLE) { |
| 62 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 62 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 63 ++instance_count_; | 63 ++instance_count_; |
| 64 | 64 |
| 65 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); | 65 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); |
| 66 SetDialogSize(CalculateSize(screen_bounds.width(), | 66 SetDialogSize(CalculateSize(screen_bounds.width(), |
| 67 kProxySettingsDialogReasonableWidth, | 67 kProxySettingsDialogReasonableWidth, |
| 68 kProxySettingsDialogReasonableWidthRatio), | 68 kProxySettingsDialogReasonableWidthRatio), |
| 69 CalculateSize(screen_bounds.height(), | 69 CalculateSize(screen_bounds.height(), |
| (...skipping 21 matching lines...) Expand all Loading... |
| 91 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED, | 91 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED, |
| 92 content::NotificationService::AllSources(), | 92 content::NotificationService::AllSources(), |
| 93 content::NotificationService::NoDetails()); | 93 content::NotificationService::NoDetails()); |
| 94 } | 94 } |
| 95 | 95 |
| 96 bool ProxySettingsDialog::IsShown() { | 96 bool ProxySettingsDialog::IsShown() { |
| 97 return instance_count_ > 0; | 97 return instance_count_ > 0; |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace chromeos | 100 } // namespace chromeos |
| OLD | NEW |