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

Side by Side Diff: views/controls/button/custom_button.cc

Issue 199025: Fix some gcc 4.4 issues when compiling with toolkit_views. (Closed)
Patch Set: Remove CreateFindBar, use COMPILER_GCC and add comments. Created 11 years, 3 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
« no previous file with comments | « chrome/chrome.gyp ('k') | views/widget/drop_target_gtk.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "views/controls/button/custom_button.h" 5 #include "views/controls/button/custom_button.h"
6 6
7 #include "app/throb_animation.h" 7 #include "app/throb_animation.h"
8 #include "base/keyboard_codes.h" 8 #include "base/keyboard_codes.h"
9 9
10 namespace views { 10 namespace views {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 bool CustomButton::AcceleratorPressed(const Accelerator& accelerator) { 89 bool CustomButton::AcceleratorPressed(const Accelerator& accelerator) {
90 if (enabled_) { 90 if (enabled_) {
91 SetState(BS_NORMAL); 91 SetState(BS_NORMAL);
92 #if defined(OS_WIN) 92 #if defined(OS_WIN)
93 KeyEvent key_event(Event::ET_KEY_RELEASED, accelerator.GetKeyCode(), 0, 0); 93 KeyEvent key_event(Event::ET_KEY_RELEASED, accelerator.GetKeyCode(), 0, 0);
94 #elif defined(OS_LINUX) 94 #elif defined(OS_LINUX)
95 GdkEventKey gdk_key; 95 GdkEventKey gdk_key;
96 memset(&gdk_key, 0, sizeof(GdkEventKey)); 96 memset(&gdk_key, 0, sizeof(GdkEventKey));
97 gdk_key.type = GDK_KEY_RELEASE; 97 gdk_key.type = GDK_KEY_RELEASE;
98 gdk_key.keyval = accelerator.GetKeyCode(); 98 gdk_key.keyval = accelerator.GetKeyCode();
99 gdk_key.state = accelerator.IsAltDown() << 3 + 99 gdk_key.state = (accelerator.IsAltDown() << 3) +
100 accelerator.IsCtrlDown() << 2 + 100 (accelerator.IsCtrlDown() << 2) +
101 accelerator.IsShiftDown(); 101 accelerator.IsShiftDown();
102 KeyEvent key_event(&gdk_key, false); 102 KeyEvent key_event(&gdk_key, false);
103 #endif 103 #endif
104 NotifyClick(key_event); 104 NotifyClick(key_event);
105 return true; 105 return true;
106 } 106 }
107 return false; 107 return false;
108 } 108 }
109 109
110 bool CustomButton::OnMousePressed(const MouseEvent& e) { 110 bool CustomButton::OnMousePressed(const MouseEvent& e) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 243
244 bool CustomButton::IsHighlighted() const { 244 bool CustomButton::IsHighlighted() const {
245 return state_ == BS_HOT; 245 return state_ == BS_HOT;
246 } 246 }
247 247
248 bool CustomButton::IsPushed() const { 248 bool CustomButton::IsPushed() const {
249 return state_ == BS_PUSHED; 249 return state_ == BS_PUSHED;
250 } 250 }
251 251
252 } // namespace views 252 } // namespace views
OLDNEW
« no previous file with comments | « chrome/chrome.gyp ('k') | views/widget/drop_target_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698