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

Side by Side Diff: chrome/browser/chromeos/login/proxy_settings_dialog.cc

Issue 14846004: Migrate ProxyConfigServiceImpl to NetworkStateHandler and NetworkProfileHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Mattias' comments. Created 7 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/chromeos/login/helper.h" 8 #include "chrome/browser/chromeos/login/helper.h"
9 #include "chrome/browser/chromeos/profiles/profile_helper.h" 9 #include "chrome/browser/chromeos/profiles/profile_helper.h"
10 #include "chrome/browser/chromeos/proxy_config_service_impl.h" 10 #include "chrome/browser/chromeos/proxy_config_service_impl.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 SetDialogSize(CalculateSize(screen_bounds.width(), 53 SetDialogSize(CalculateSize(screen_bounds.width(),
54 kProxySettingsDialogReasonableWidth, 54 kProxySettingsDialogReasonableWidth,
55 kProxySettingsDialogReasonableWidthRatio), 55 kProxySettingsDialogReasonableWidthRatio),
56 CalculateSize(screen_bounds.height(), 56 CalculateSize(screen_bounds.height(),
57 kProxySettingsDialogReasonableHeight, 57 kProxySettingsDialogReasonableHeight,
58 kProxySettingsDialogReasonableHeightRatio)); 58 kProxySettingsDialogReasonableHeightRatio));
59 59
60 // Get network name for dialog title. 60 // Get network name for dialog title.
61 Profile* profile = ProfileHelper::GetSigninProfile(); 61 Profile* profile = ProfileHelper::GetSigninProfile();
62 PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker(); 62 PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker();
63 proxy_tracker->UIMakeActiveNetworkCurrent(); 63 proxy_tracker->UIMakeDefaultNetworkCurrent();
64 std::string network_name; 64 std::string network_name;
65 proxy_tracker->UIGetCurrentNetworkName(&network_name); 65 proxy_tracker->UIGetCurrentNetworkName(&network_name);
66 SetDialogTitle(l10n_util::GetStringFUTF16(IDS_PROXY_PAGE_TITLE_FORMAT, 66 SetDialogTitle(l10n_util::GetStringFUTF16(IDS_PROXY_PAGE_TITLE_FORMAT,
67 ASCIIToUTF16(network_name))); 67 ASCIIToUTF16(network_name)));
68 } 68 }
69 69
70 ProxySettingsDialog::~ProxySettingsDialog() { 70 ProxySettingsDialog::~ProxySettingsDialog() {
71 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 71 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
72 --instance_count_; 72 --instance_count_;
73 } 73 }
74 74
75 void ProxySettingsDialog::OnDialogClosed(const std::string& json_retval) { 75 void ProxySettingsDialog::OnDialogClosed(const std::string& json_retval) {
76 LoginWebDialog::OnDialogClosed(json_retval); 76 LoginWebDialog::OnDialogClosed(json_retval);
77 content::NotificationService::current()->Notify( 77 content::NotificationService::current()->Notify(
78 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED, 78 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED,
79 content::NotificationService::AllSources(), 79 content::NotificationService::AllSources(),
80 content::NotificationService::NoDetails()); 80 content::NotificationService::NoDetails());
81 } 81 }
82 82
83 bool ProxySettingsDialog::IsShown() { 83 bool ProxySettingsDialog::IsShown() {
84 return instance_count_ > 0; 84 return instance_count_ > 0;
85 } 85 }
86 86
87 } // namespace chromeos 87 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698