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

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

Issue 635573005: Cleanup: Better constify some strings in chrome/browser/{chromeos,extensions}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase, nit Created 6 years, 1 month 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 11 matching lines...) Expand all
22 #include "ui/gfx/size.h" 22 #include "ui/gfx/size.h"
23 23
24 namespace { 24 namespace {
25 25
26 // Hints for size of proxy settings dialog. 26 // Hints for size of proxy settings dialog.
27 const int kProxySettingsDialogReasonableWidth = 626; 27 const int kProxySettingsDialogReasonableWidth = 626;
28 const int kProxySettingsDialogReasonableHeight = 525; 28 const int kProxySettingsDialogReasonableHeight = 525;
29 const float kProxySettingsDialogReasonableWidthRatio = 0.4f; 29 const float kProxySettingsDialogReasonableWidthRatio = 0.4f;
30 const float kProxySettingsDialogReasonableHeightRatio = 0.4f; 30 const float kProxySettingsDialogReasonableHeightRatio = 0.4f;
31 31
32 const char* kProxySettingsURLParam = "?network=%s"; 32 const char kProxySettingsURLParam[] = "?network=%s";
33 33
34 int CalculateSize(int screen_size, int min_comfortable, float desired_ratio) { 34 int CalculateSize(int screen_size, int min_comfortable, float desired_ratio) {
35 int desired_size = static_cast<int>(desired_ratio * screen_size); 35 int desired_size = static_cast<int>(desired_ratio * screen_size);
36 desired_size = std::max(min_comfortable, desired_size); 36 desired_size = std::max(min_comfortable, desired_size);
37 return std::min(screen_size, desired_size); 37 return std::min(screen_size, desired_size);
38 } 38 }
39 39
40 GURL GetURLForProxySettings(const std::string& service_path) { 40 GURL GetURLForProxySettings(const std::string& service_path) {
41 std::string url(chrome::kChromeUIProxySettingsURL); 41 std::string url(chrome::kChromeUIProxySettingsURL);
42 url += base::StringPrintf( 42 url += base::StringPrintf(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
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