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

Unified Diff: views/controls/button/menu_button.cc

Issue 115826: Makes MenuButton compile and fixes bug in GtkWidget I happened upon.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | views/views.gyp » ('j') | views/widget/widget_gtk.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/button/menu_button.cc
===================================================================
--- views/controls/button/menu_button.cc (revision 17002)
+++ views/controls/button/menu_button.cc (working copy)
@@ -8,7 +8,6 @@
#include "app/gfx/canvas.h"
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
-#include "app/win_util.h"
#include "grit/app_strings.h"
#include "grit/app_resources.h"
#include "views/controls/button/button.h"
@@ -17,6 +16,10 @@
#include "views/widget/root_view.h"
#include "views/widget/widget.h"
+#if defined(OS_WIN)
+#include "app/win_util.h"
+#endif
+
using base::Time;
using base::TimeDelta;
@@ -109,6 +112,7 @@
return 0;
}
+#if defined(OS_WIN)
HWND hwnd = widget->GetNativeView();
RECT t;
::GetWindowRect(hwnd, &t);
@@ -116,6 +120,10 @@
gfx::Rect r(t);
gfx::Rect monitor_rect = win_util::GetMonitorBoundsForRect(r);
return monitor_rect.x() + monitor_rect.width() - 1;
+#else
+ NOTIMPLEMENTED();
+ return 1000000;
+#endif
}
bool MenuButton::Activate() {
@@ -205,9 +213,13 @@
// When the space bar or the enter key is pressed we need to show the menu.
bool MenuButton::OnKeyReleased(const KeyEvent& e) {
+#if defined(OS_WIN)
if ((e.GetCharacter() == VK_SPACE) || (e.GetCharacter() == VK_RETURN)) {
return Activate();
}
+#else
+ NOTIMPLEMENTED();
+#endif
return true;
}
« no previous file with comments | « no previous file | views/views.gyp » ('j') | views/widget/widget_gtk.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698