| 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" |
| 11 #include "chrome/common/url_constants.h" | 11 #include "chrome/common/url_constants.h" |
| 12 #include "chromeos/network/network_state.h" | 12 #include "chromeos/network/network_state.h" |
| 13 #include "chromeos/network/shill_property_util.h" | 13 #include "chromeos/network/shill_property_util.h" |
| 14 #include "content/public/browser/browser_context.h" |
| 14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 15 #include "content/public/browser/notification_service.h" | 16 #include "content/public/browser/notification_service.h" |
| 16 #include "grit/generated_resources.h" | 17 #include "grit/generated_resources.h" |
| 17 #include "net/base/escape.h" | 18 #include "net/base/escape.h" |
| 18 #include "third_party/cros_system_api/dbus/service_constants.h" | 19 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 19 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
| 20 #include "ui/gfx/rect.h" | 21 #include "ui/gfx/rect.h" |
| 21 #include "ui/gfx/size.h" | 22 #include "ui/gfx/size.h" |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 44 return GURL(url); | 45 return GURL(url); |
| 45 } | 46 } |
| 46 | 47 |
| 47 } // namespace | 48 } // namespace |
| 48 | 49 |
| 49 namespace chromeos { | 50 namespace chromeos { |
| 50 | 51 |
| 51 // static | 52 // static |
| 52 int ProxySettingsDialog::instance_count_ = 0; | 53 int ProxySettingsDialog::instance_count_ = 0; |
| 53 | 54 |
| 54 ProxySettingsDialog::ProxySettingsDialog(Profile* profile, | 55 ProxySettingsDialog::ProxySettingsDialog( |
| 55 const NetworkState& network, | 56 content::BrowserContext* browser_context, |
| 56 LoginWebDialog::Delegate* delegate, | 57 const NetworkState& network, |
| 57 gfx::NativeWindow window) | 58 LoginWebDialog::Delegate* delegate, |
| 58 : LoginWebDialog(profile, | 59 gfx::NativeWindow window) |
| 60 : LoginWebDialog(browser_context, |
| 59 delegate, | 61 delegate, |
| 60 window, | 62 window, |
| 61 base::string16(), | 63 base::string16(), |
| 62 GetURLForProxySettings(network.path()), | 64 GetURLForProxySettings(network.path()), |
| 63 LoginWebDialog::STYLE_BUBBLE) { | 65 LoginWebDialog::STYLE_BUBBLE) { |
| 64 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 66 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
| 65 ++instance_count_; | 67 ++instance_count_; |
| 66 | 68 |
| 67 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); | 69 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); |
| 68 SetDialogSize(CalculateSize(screen_bounds.width(), | 70 SetDialogSize(CalculateSize(screen_bounds.width(), |
| (...skipping 24 matching lines...) Expand all Loading... |
| 93 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED, | 95 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED, |
| 94 content::NotificationService::AllSources(), | 96 content::NotificationService::AllSources(), |
| 95 content::NotificationService::NoDetails()); | 97 content::NotificationService::NoDetails()); |
| 96 } | 98 } |
| 97 | 99 |
| 98 bool ProxySettingsDialog::IsShown() { | 100 bool ProxySettingsDialog::IsShown() { |
| 99 return instance_count_ > 0; | 101 return instance_count_ > 0; |
| 100 } | 102 } |
| 101 | 103 |
| 102 } // namespace chromeos | 104 } // namespace chromeos |
| OLD | NEW |