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 #ifndef CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSION_HELPER_H_ 6 #define CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSION_HELPER_H_ 7 8 #include "base/macros.h" 9 #include "base/memory/scoped_ptr.h" 10 #include "content/public/renderer/render_view_observer.h" 11 #include "content/public/renderer/render_view_observer_tracker.h" 12 13 struct WebApplicationInfo; 14 15 namespace extensions { 16 17 // RenderView plumbing for Chrome-specific extension features. 18 // See also extensions/renderer/extension_helper.h. 19 class ChromeExtensionHelper 20 : public content::RenderViewObserver, 21 public content::RenderViewObserverTracker<ChromeExtensionHelper> { 22 public: 23 explicit ChromeExtensionHelper(content::RenderView* render_view); 24 virtual ~ChromeExtensionHelper(); 25 26 private: 27 // RenderViewObserver implementation. 28 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 29 30 // IPC message handlers. 31 void OnGetApplicationInfo(int page_id); 32 33 // The app info that we are processing. This is used when installing an app 34 // via application definition. The in-progress web app is stored here while 35 // its manifest and icons are downloaded. 36 scoped_ptr<WebApplicationInfo> pending_app_info_; 37 38 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionHelper); 39 }; 40 41 } // namespace extensions 42 43 #endif // CHROME_RENDERER_EXTENSIONS_CHROME_EXTENSION_HELPER_H_ 44