Suppression for crbug/241044.
[chromium-blink-merge.git] / chrome / renderer / extensions / app_bindings.h
blob53057831a00999a5f55468f45f5334a71eb86233
1 // Copyright (c) 2012 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 // The AppObjectExtension is a v8 extension that creates an object
6 // at window.chrome.app. This object allows javascript to get details
7 // on the app state of the page.
8 // The read-only property app.isInstalled is true if the current page is
9 // within the extent of an installed, enabled app.
11 #ifndef CHROME_RENDERER_EXTENSIONS_APP_BINDINGS_H_
12 #define CHROME_RENDERER_EXTENSIONS_APP_BINDINGS_H_
14 #include "base/compiler_specific.h"
15 #include "chrome/renderer/extensions/chrome_v8_extension.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
18 namespace extensions {
19 class ChromeV8Context;
21 // Implements the chrome.app JavaScript object.
23 // TODO(aa): Add unit testing for this class.
24 class AppBindings : public ChromeV8Extension,
25 public ChromeV8ExtensionHandler {
26 public:
27 AppBindings(Dispatcher* dispatcher, ChromeV8Context* context);
29 private:
30 // IPC::Listener
31 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
33 v8::Handle<v8::Value> GetIsInstalled(const v8::Arguments& args);
34 v8::Handle<v8::Value> GetDetails(const v8::Arguments& args);
35 v8::Handle<v8::Value> GetDetailsForFrame(const v8::Arguments& args);
36 v8::Handle<v8::Value> GetInstallState(const v8::Arguments& args);
37 v8::Handle<v8::Value> GetRunningState(const v8::Arguments& args);
39 v8::Handle<v8::Value> GetDetailsForFrameImpl(WebKit::WebFrame* frame);
41 void OnAppInstallStateResponse(const std::string& state, int callback_id);
43 DISALLOW_COPY_AND_ASSIGN(AppBindings);
46 } // namespace extensions
48 #endif // CHROME_RENDERER_EXTENSIONS_APP_BINDINGS_H_