summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/extensions/chrome_extension_helper.h
blob: 2ec4478e2fbf8b48ccadd6584e1e7ac62324b096 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// 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_RENDERER_EXTENSIONS_CHROME_EXTENSION_HELPER_H_
#define CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSION_HELPER_H_

#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "content/public/renderer/render_view_observer.h"
#include "content/public/renderer/render_view_observer_tracker.h"

struct WebApplicationInfo;

namespace extensions {

// RenderView plumbing for Chrome-specific extension features.
// See also extensions/renderer/extension_helper.h.
class ChromeExtensionHelper
    : public content::RenderViewObserver,
      public content::RenderViewObserverTracker<ChromeExtensionHelper> {
 public:
  explicit ChromeExtensionHelper(content::RenderView* render_view);
  virtual ~ChromeExtensionHelper();

 private:
  // RenderViewObserver implementation.
  virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;

  // IPC message handlers.
  void OnGetApplicationInfo();

  // The app info that we are processing. This is used when installing an app
  // via application definition. The in-progress web app is stored here while
  // its manifest and icons are downloaded.
  scoped_ptr<WebApplicationInfo> pending_app_info_;

  DISALLOW_COPY_AND_ASSIGN(ChromeExtensionHelper);
};

}  // namespace extensions

#endif  // CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSION_HELPER_H_