OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/proxy_settings_dialog.h" | 5 #include "chrome/browser/chromeos/login/ui/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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 ProxySettingsDialog::ProxySettingsDialog( | 55 ProxySettingsDialog::ProxySettingsDialog( |
56 content::BrowserContext* browser_context, | 56 content::BrowserContext* browser_context, |
57 const NetworkState& network, | 57 const NetworkState& network, |
58 LoginWebDialog::Delegate* delegate, | 58 LoginWebDialog::Delegate* delegate, |
59 gfx::NativeWindow window) | 59 gfx::NativeWindow window) |
60 : LoginWebDialog(browser_context, | 60 : LoginWebDialog(browser_context, |
61 delegate, | 61 delegate, |
62 window, | 62 window, |
63 base::string16(), | 63 base::string16(), |
64 GetURLForProxySettings(network.path()), | 64 GetURLForProxySettings(network.path())) { |
65 LoginWebDialog::STYLE_BUBBLE) { | |
66 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 65 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
67 ++instance_count_; | 66 ++instance_count_; |
68 | 67 |
69 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); | 68 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); |
70 SetDialogSize(CalculateSize(screen_bounds.width(), | 69 SetDialogSize(CalculateSize(screen_bounds.width(), |
71 kProxySettingsDialogReasonableWidth, | 70 kProxySettingsDialogReasonableWidth, |
72 kProxySettingsDialogReasonableWidthRatio), | 71 kProxySettingsDialogReasonableWidthRatio), |
73 CalculateSize(screen_bounds.height(), | 72 CalculateSize(screen_bounds.height(), |
74 kProxySettingsDialogReasonableHeight, | 73 kProxySettingsDialogReasonableHeight, |
75 kProxySettingsDialogReasonableHeightRatio)); | 74 kProxySettingsDialogReasonableHeightRatio)); |
(...skipping 19 matching lines...) Expand all Loading... |
95 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED, | 94 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED, |
96 content::NotificationService::AllSources(), | 95 content::NotificationService::AllSources(), |
97 content::NotificationService::NoDetails()); | 96 content::NotificationService::NoDetails()); |
98 } | 97 } |
99 | 98 |
100 bool ProxySettingsDialog::IsShown() { | 99 bool ProxySettingsDialog::IsShown() { |
101 return instance_count_ > 0; | 100 return instance_count_ > 0; |
102 } | 101 } |
103 | 102 |
104 } // namespace chromeos | 103 } // namespace chromeos |
OLD | NEW |