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

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

Issue 6880201: Scrap WNDCLASSEX.hCursor, update GetCursorForPoint, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use brace style struct init for WNDCLASSEX |class_ex|, fix comment. Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/shutdown_button.h » ('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) 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 "chrome/browser/chromeos/login/background_view.h" 5 #include "chrome/browser/chromeos/login/background_view.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/string16.h" 10 #include "base/string16.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 case chromeos::BackgroundView::REGISTRATION: 67 case chromeos::BackgroundView::REGISTRATION:
68 return IDS_OOBE_REGISTRATION; 68 return IDS_OOBE_REGISTRATION;
69 case chromeos::BackgroundView::PICTURE: 69 case chromeos::BackgroundView::PICTURE:
70 return IDS_OOBE_PICTURE; 70 return IDS_OOBE_PICTURE;
71 default: 71 default:
72 NOTREACHED(); 72 NOTREACHED();
73 return 0; 73 return 0;
74 } 74 }
75 } 75 }
76 76
77 // The same as TextButton but switches cursor to hand cursor when mouse
78 // is over the button.
79 class TextButtonWithHandCursorOver : public views::TextButton {
80 public:
81 TextButtonWithHandCursorOver(views::ButtonListener* listener,
82 const std::wstring& text)
83 : views::TextButton(listener, text) {
84 }
85
86 virtual ~TextButtonWithHandCursorOver() {}
87
88 virtual gfx::NativeCursor GetCursorForPoint(
89 ui::EventType event_type,
90 const gfx::Point& p) {
91 if (!IsEnabled()) {
92 return NULL;
93 }
94 return gfx::GetCursor(GDK_HAND2);
95 }
96
97 private:
98 DISALLOW_COPY_AND_ASSIGN(TextButtonWithHandCursorOver);
99 };
100
101 // This gets rid of the ugly X default cursor. 77 // This gets rid of the ugly X default cursor.
102 static void ResetXCursor() { 78 static void ResetXCursor() {
103 // TODO(sky): nuke this once new window manager is in place. 79 // TODO(sky): nuke this once new window manager is in place.
104 Display* display = ui::GetXDisplay(); 80 Display* display = ui::GetXDisplay();
105 Cursor cursor = XCreateFontCursor(display, XC_left_ptr); 81 Cursor cursor = XCreateFontCursor(display, XC_left_ptr);
106 XID root_window = ui::GetX11RootWindow(); 82 XID root_window = ui::GetX11RootWindow();
107 XSetWindowAttributes attr; 83 XSetWindowAttributes attr;
108 attr.cursor = cursor; 84 attr.cursor = cursor;
109 XChangeWindowAttributes(display, root_window, CWCursor, &attr); 85 XChangeWindowAttributes(display, root_window, CWCursor, &attr);
110 } 86 }
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 boot_times_label_->SetText(ASCIIToWide(boot_times_text)); 531 boot_times_label_->SetText(ASCIIToWide(boot_times_text));
556 } 532 }
557 533
558 void BackgroundView::OnPolicyStateChanged( 534 void BackgroundView::OnPolicyStateChanged(
559 policy::CloudPolicySubsystem::PolicySubsystemState state, 535 policy::CloudPolicySubsystem::PolicySubsystemState state,
560 policy::CloudPolicySubsystem::ErrorDetails error_details) { 536 policy::CloudPolicySubsystem::ErrorDetails error_details) {
561 UpdateEnterpriseInfo(); 537 UpdateEnterpriseInfo();
562 } 538 }
563 539
564 } // namespace chromeos 540 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/shutdown_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698