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

Unified Diff: ui/app_list/views/app_list_view.cc

Issue 210083009: Add a whole-app-list unit test. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase due to fight with r270606 Created 6 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 | « ui/app_list/views/app_list_view.h ('k') | ui/app_list/views/app_list_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_view.cc
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index 0c5c5f705315148f3f60a75e5daf9dd48bb70075..a7f607da5e433d6c42f89ad864613cc947c1310c 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -53,8 +53,6 @@ namespace app_list {
namespace {
-void (*g_next_paint_callback)();
-
// The margin from the edge to the speech UI.
const int kSpeechUIMargin = 12;
@@ -206,9 +204,9 @@ gfx::Size AppListView::GetPreferredSize() {
void AppListView::Paint(gfx::Canvas* canvas, const views::CullSet& cull_set) {
views::BubbleDelegateView::Paint(canvas, cull_set);
- if (g_next_paint_callback) {
- g_next_paint_callback();
- g_next_paint_callback = NULL;
+ if (!next_paint_callback_.is_null()) {
+ next_paint_callback_.Run();
+ next_paint_callback_.Reset();
}
}
@@ -250,8 +248,8 @@ void AppListView::RemoveObserver(AppListViewObserver* observer) {
}
// static
-void AppListView::SetNextPaintCallback(void (*callback)()) {
- g_next_paint_callback = callback;
+void AppListView::SetNextPaintCallback(const base::Closure& callback) {
+ next_paint_callback_ = callback;
}
#if defined(OS_WIN)
« no previous file with comments | « ui/app_list/views/app_list_view.h ('k') | ui/app_list/views/app_list_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698