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

Side by Side Diff: chrome/browser/ui/app_list/launcher_page_event_dispatcher.cc

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: fix mac compile Created 6 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/app_list/launcher_page_event_dispatcher.h"
6
7 #include "base/values.h"
8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/common/extensions/api/launcher_page.h"
10 #include "extensions/browser/event_router.h"
11
12 namespace OnTransitionChanged =
13 extensions::api::launcher_page::OnTransitionChanged;
14
15 namespace app_list {
16
17 LauncherPageEventDispatcher::LauncherPageEventDispatcher(
18 Profile* profile,
19 const std::string& extension_id)
20 : profile_(profile), extension_id_(extension_id) {
21 }
22
23 LauncherPageEventDispatcher::~LauncherPageEventDispatcher() {
24 }
25
26 void LauncherPageEventDispatcher::ProgressChanged(double progress) {
27 SendEventToLauncherPage(OnTransitionChanged::kEventName,
28 OnTransitionChanged::Create(progress));
29 }
30
31 void LauncherPageEventDispatcher::SendEventToLauncherPage(
32 const std::string& event_name,
33 scoped_ptr<base::ListValue> args) {
34 scoped_ptr<extensions::Event> event(
35 new extensions::Event(event_name, args.Pass()));
36 extensions::EventRouter::Get(profile_)
37 ->DispatchEventToExtension(extension_id_, event.Pass());
38 }
39
40 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/launcher_page_event_dispatcher.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698