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

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

Issue 4179001: [cros] Fix UI issues on SignIn pod. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/login/helper.h ('k') | chrome/browser/chromeos/login/login_screen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/helper.h" 5 #include "chrome/browser/chromeos/login/helper.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "chrome/browser/google/google_util.h" 8 #include "chrome/browser/google/google_util.h"
9 #include "gfx/canvas_skia.h" 9 #include "gfx/canvas_skia.h"
10 #include "googleurl/src/gurl.h" 10 #include "googleurl/src/gurl.h"
11 #include "grit/theme_resources.h" 11 #include "grit/theme_resources.h"
12 #include "third_party/skia/include/effects/SkGradientShader.h" 12 #include "third_party/skia/include/effects/SkGradientShader.h"
13 #include "views/controls/button/native_button.h"
14 #include "views/controls/textfield/textfield.h"
13 #include "views/controls/throbber.h" 15 #include "views/controls/throbber.h"
14 #include "views/painter.h" 16 #include "views/painter.h"
15 #include "views/screen.h" 17 #include "views/screen.h"
16 18
17 namespace chromeos { 19 namespace chromeos {
18 20
19 namespace { 21 namespace {
20 22
23 // Font size correction in points for login/oobe textfields/buttons.
24 const int kFontSizeCorrectionDelta = 2;
25
21 // Time in ms per throbber frame. 26 // Time in ms per throbber frame.
22 const int kThrobberFrameMs = 60; 27 const int kThrobberFrameMs = 60;
23 28
24 // Time in ms before smothed throbber is shown. 29 // Time in ms before smoothed throbber is shown.
25 const int kThrobberStartDelayMs = 500; 30 const int kThrobberStartDelayMs = 500;
26 31
27 const SkColor kBackgroundCenterColor = SkColorSetRGB(41, 50, 67); 32 const SkColor kBackgroundCenterColor = SkColorSetRGB(41, 50, 67);
28 const SkColor kBackgroundEdgeColor = SK_ColorBLACK; 33 const SkColor kBackgroundEdgeColor = SK_ColorBLACK;
29 34
30 const char kAccountRecoveryHelpUrl[] = 35 const char kAccountRecoveryHelpUrl[] =
31 "http://www.google.com/support/accounts/bin/answer.py?answer=48598"; 36 "http://www.google.com/support/accounts/bin/answer.py?answer=48598";
32 37
33 class BackgroundPainter : public views::Painter { 38 class BackgroundPainter : public views::Painter {
34 public: 39 public:
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 gfx::Rect bounds(views::Screen::GetMonitorWorkAreaNearestWindow(NULL)); 92 gfx::Rect bounds(views::Screen::GetMonitorWorkAreaNearestWindow(NULL));
88 if (!size.IsEmpty()) { 93 if (!size.IsEmpty()) {
89 int horizontal_diff = bounds.width() - size.width(); 94 int horizontal_diff = bounds.width() - size.width();
90 int vertical_diff = bounds.height() - size.height(); 95 int vertical_diff = bounds.height() - size.height();
91 bounds.Inset(horizontal_diff / 2, vertical_diff / 2); 96 bounds.Inset(horizontal_diff / 2, vertical_diff / 2);
92 } 97 }
93 98
94 return bounds; 99 return bounds;
95 } 100 }
96 101
102 void CorrectNativeButtonFontSize(views::NativeButton* button) {
103 if (button)
104 button->SetFont(button->font().DeriveFont(kFontSizeCorrectionDelta));
105 }
106
107 void CorrectTextfieldFontSize(views::Textfield* textfield) {
108 if (textfield)
109 textfield->SetFont(textfield->font().DeriveFont(kFontSizeCorrectionDelta));
110 }
111
97 GURL GetAccountRecoveryHelpUrl() { 112 GURL GetAccountRecoveryHelpUrl() {
98 return google_util::AppendGoogleLocaleParam(GURL(kAccountRecoveryHelpUrl)); 113 return google_util::AppendGoogleLocaleParam(GURL(kAccountRecoveryHelpUrl));
99 } 114 }
100 115
101 } // namespace chromeos 116 } // namespace chromeos
102 117
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/helper.h ('k') | chrome/browser/chromeos/login/login_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698