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

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

Issue 1049873005: [chrome/browser/chromeos/] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.guid())) { 64 GetURLForProxySettings(network.guid())) {
65 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 65 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
66 ++instance_count_; 66 ++instance_count_;
67 67
68 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); 68 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size()));
69 SetDialogSize(CalculateSize(screen_bounds.width(), 69 SetDialogSize(CalculateSize(screen_bounds.width(),
70 kProxySettingsDialogReasonableWidth, 70 kProxySettingsDialogReasonableWidth,
71 kProxySettingsDialogReasonableWidthRatio), 71 kProxySettingsDialogReasonableWidthRatio),
72 CalculateSize(screen_bounds.height(), 72 CalculateSize(screen_bounds.height(),
73 kProxySettingsDialogReasonableHeight, 73 kProxySettingsDialogReasonableHeight,
74 kProxySettingsDialogReasonableHeightRatio)); 74 kProxySettingsDialogReasonableHeightRatio));
75 75
76 std::string network_name = network.name(); 76 std::string network_name = network.name();
77 if (network_name.empty() && network.Matches(NetworkTypePattern::Ethernet())) { 77 if (network_name.empty() && network.Matches(NetworkTypePattern::Ethernet())) {
78 network_name = 78 network_name =
79 l10n_util::GetStringUTF8(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET); 79 l10n_util::GetStringUTF8(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET);
80 } 80 }
81 81
82 SetDialogTitle(l10n_util::GetStringFUTF16(IDS_PROXY_PAGE_TITLE_FORMAT, 82 SetDialogTitle(l10n_util::GetStringFUTF16(IDS_PROXY_PAGE_TITLE_FORMAT,
83 base::ASCIIToUTF16(network_name))); 83 base::ASCIIToUTF16(network_name)));
84 } 84 }
85 85
86 ProxySettingsDialog::~ProxySettingsDialog() { 86 ProxySettingsDialog::~ProxySettingsDialog() {
87 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 87 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
88 --instance_count_; 88 --instance_count_;
89 } 89 }
90 90
91 void ProxySettingsDialog::OnDialogClosed(const std::string& json_retval) { 91 void ProxySettingsDialog::OnDialogClosed(const std::string& json_retval) {
92 LoginWebDialog::OnDialogClosed(json_retval); 92 LoginWebDialog::OnDialogClosed(json_retval);
93 content::NotificationService::current()->Notify( 93 content::NotificationService::current()->Notify(
94 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED, 94 chrome::NOTIFICATION_LOGIN_PROXY_CHANGED,
95 content::NotificationService::AllSources(), 95 content::NotificationService::AllSources(),
96 content::NotificationService::NoDetails()); 96 content::NotificationService::NoDetails());
97 } 97 }
98 98
99 bool ProxySettingsDialog::IsShown() { 99 bool ProxySettingsDialog::IsShown() {
100 return instance_count_ > 0; 100 return instance_count_ > 0;
101 } 101 }
102 102
103 } // namespace chromeos 103 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698