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

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

Issue 6973029: Integrate WebUI Login with cros. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated code in response to review comments Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <X11/cursorfont.h>
6 #include <X11/Xcursor/Xcursor.h>
7
5 #include "chrome/browser/chromeos/login/helper.h" 8 #include "chrome/browser/chromeos/login/helper.h"
6 9
7 #include "base/file_util.h" 10 #include "base/file_util.h"
8 #include "chrome/browser/chromeos/cros/network_library.h" 11 #include "chrome/browser/chromeos/cros/network_library.h"
9 #include "chrome/browser/chromeos/system_access.h" 12 #include "chrome/browser/chromeos/system_access.h"
10 #include "chrome/browser/google/google_util.h" 13 #include "chrome/browser/google/google_util.h"
11 #include "googleurl/src/gurl.h" 14 #include "googleurl/src/gurl.h"
12 #include "grit/generated_resources.h" 15 #include "grit/generated_resources.h"
13 #include "grit/theme_resources.h" 16 #include "grit/theme_resources.h"
14 #include "third_party/skia/include/effects/SkGradientShader.h" 17 #include "third_party/skia/include/effects/SkGradientShader.h"
15 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
16 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/base/resource/resource_bundle.h"
20 #include "ui/base/x/x11_util.h"
17 #include "ui/gfx/canvas_skia.h" 21 #include "ui/gfx/canvas_skia.h"
18 #include "views/controls/button/menu_button.h" 22 #include "views/controls/button/menu_button.h"
19 #include "views/controls/button/native_button.h" 23 #include "views/controls/button/native_button.h"
20 #include "views/controls/label.h" 24 #include "views/controls/label.h"
21 #include "views/controls/textfield/textfield.h" 25 #include "views/controls/textfield/textfield.h"
22 #include "views/controls/throbber.h" 26 #include "views/controls/throbber.h"
23 #include "views/painter.h" 27 #include "views/painter.h"
24 #include "views/screen.h" 28 #include "views/screen.h"
25 #include "views/widget/widget.h" 29 #include "views/widget/widget.h"
26 #include "views/widget/widget_gtk.h" 30 #include "views/widget/widget_gtk.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 return l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET); 215 return l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_ETHERNET);
212 } else if (network_library->wifi_connecting()) { 216 } else if (network_library->wifi_connecting()) {
213 return UTF8ToUTF16(network_library->wifi_network()->name()); 217 return UTF8ToUTF16(network_library->wifi_network()->name());
214 } else if (network_library->cellular_connecting()) { 218 } else if (network_library->cellular_connecting()) {
215 return UTF8ToUTF16(network_library->cellular_network()->name()); 219 return UTF8ToUTF16(network_library->cellular_network()->name());
216 } else { 220 } else {
217 return string16(); 221 return string16();
218 } 222 }
219 } 223 }
220 224
225 void ResetXCursor() {
226 // TODO(sky): nuke this once new window manager is in place.
oshima 2011/05/19 01:45:19 can you double chceck with Dan (derat) if this is
rharrison 2011/05/19 16:45:28 Sent him an e-mail, awaiting a response.
227 Display* display = ui::GetXDisplay();
228 Cursor cursor = XCreateFontCursor(display, XC_left_ptr);
229 XID root_window = ui::GetX11RootWindow();
230 XSetWindowAttributes attr;
231 attr.cursor = cursor;
232 XChangeWindowAttributes(display, root_window, CWCursor, &attr);
233 }
234
221 namespace login { 235 namespace login {
222 236
223 gfx::Size WideButton::GetPreferredSize() { 237 gfx::Size WideButton::GetPreferredSize() {
224 gfx::Size preferred_size = NativeButton::GetPreferredSize(); 238 gfx::Size preferred_size = NativeButton::GetPreferredSize();
225 // Set minimal width. 239 // Set minimal width.
226 if (preferred_size.width() < kButtonMinWidth) 240 if (preferred_size.width() < kButtonMinWidth)
227 preferred_size.set_width(kButtonMinWidth); 241 preferred_size.set_width(kButtonMinWidth);
228 return preferred_size; 242 return preferred_size;
229 } 243 }
230 244
231 } // namespace login 245 } // namespace login
232 246
233 } // namespace chromeos 247 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698