Unregister from GCM when the only GCM app is removed
[chromium-blink-merge.git] / chrome / test / data / webui / async_gen.cc
blob4e22cb369466963d8b5c67576b76677ebc6d366c
1 // Copyright (c) 2011 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.
5 #include "chrome/test/data/webui/async_gen.h"
7 #include "base/bind.h"
8 #include "base/bind_helpers.h"
9 #include "base/values.h"
10 #include "content/public/browser/web_ui.h"
12 WebUIBrowserAsyncGenTest::WebUIBrowserAsyncGenTest() {}
14 WebUIBrowserAsyncGenTest::~WebUIBrowserAsyncGenTest() {}
16 WebUIBrowserAsyncGenTest::AsyncWebUIMessageHandler::
17 AsyncWebUIMessageHandler() {}
19 WebUIBrowserAsyncGenTest::AsyncWebUIMessageHandler::
20 ~AsyncWebUIMessageHandler() {}
22 void WebUIBrowserAsyncGenTest::AsyncWebUIMessageHandler::HandleCallJS(
23 const base::ListValue* list_value) {
24 std::string call_js;
25 ASSERT_TRUE(list_value->GetString(0, &call_js));
26 web_ui()->CallJavascriptFunction(call_js);
29 void WebUIBrowserAsyncGenTest::AsyncWebUIMessageHandler::RegisterMessages() {
30 web_ui()->RegisterMessageCallback(
31 "callJS", base::Bind(&AsyncWebUIMessageHandler::HandleCallJS,
32 base::Unretained(this)));
33 web_ui()->RegisterMessageCallback(
34 "tearDown", base::Bind(&AsyncWebUIMessageHandler::HandleTearDown,
35 base::Unretained(this)));