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

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

Issue 13633003: Part of multiprofile implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 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
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/proxy_config_service_impl.h" 9 #include "chrome/browser/chromeos/proxy_config_service_impl.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); 52 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size()));
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 = ProfileManager::GetDefaultProfile(); 61 Profile* profile = ProfileManager::GetSigninProfile();
62 PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker(); 62 PrefProxyConfigTracker* proxy_tracker = profile->GetProxyConfigTracker();
63 proxy_tracker->UIMakeActiveNetworkCurrent(); 63 proxy_tracker->UIMakeActiveNetworkCurrent();
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