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

Unified Diff: chrome/browser/ui/app_list/launcher_page_event_dispatcher_views.h

Issue 683703002: Notify launcher page with onTransitionChanged event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@launcher_page_api_show_state_notify
Patch Set: nullptr like it's 1999 Created 6 years, 2 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
Index: chrome/browser/ui/app_list/launcher_page_event_dispatcher_views.h
diff --git a/chrome/browser/ui/app_list/launcher_page_event_dispatcher_views.h b/chrome/browser/ui/app_list/launcher_page_event_dispatcher_views.h
new file mode 100644
index 0000000000000000000000000000000000000000..ac44647165d72ac516c7822f6e2527077b392290
--- /dev/null
+++ b/chrome/browser/ui/app_list/launcher_page_event_dispatcher_views.h
@@ -0,0 +1,54 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_VIEWS_H_
+#define CHROME_BROWSER_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_VIEWS_H_
+
+#include "base/basictypes.h"
+#include "chrome/browser/ui/host_desktop.h"
+#include "ui/app_list/pagination_model_observer.h"
+#include "ui/app_list/views/app_list_main_view.h"
+
+namespace base {
+class ListValue;
+}
+
+namespace app_list {
+
+class AppListMainView;
+
+// A class which observes the app list and sends events to the custom launcher
+// page.
+class LauncherPageEventDispatcherViews : public PaginationModelObserver,
+ public AppListMainViewObserver {
+ public:
+ LauncherPageEventDispatcherViews(chrome::HostDesktopType host_desktop,
+ Profile* profile,
+ const std::string& extension_id);
+ ~LauncherPageEventDispatcherViews() override;
+
+ // Overridden from PaginationModelObserver:
+ void SelectedPageChanged(int old_selected, int new_selected) override;
+ void TransitionStarted() override;
+ void TransitionChanged() override;
+
+ // Overridden from AppListMainViewObserver:
+ void OnContentsViewCreated() override;
+ void OnContentsViewDestroying() override;
+
+ private:
+ void SendEventToLauncherPage(const std::string& event_name,
+ scoped_ptr<base::ListValue> args);
+
+ Profile* profile_;
+ std::string extension_id_;
+
+ AppListMainView* main_view_;
+
+ DISALLOW_COPY_AND_ASSIGN(LauncherPageEventDispatcherViews);
+};
+
+} // namespace app_list
+
+#endif // CHROME_BROWSER_UI_APP_LIST_LAUNCHER_PAGE_EVENT_DISPATCHER_VIEWS_H_

Powered by Google App Engine
This is Rietveld 408576698