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

Unified Diff: chrome/browser/extensions/extension_tab_helper.h

Issue 8113006: Add js api for hosted/pacakged apps to request notification authorization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added process check, and moved to ExtensionTabHelper Created 9 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_tab_helper.h
diff --git a/chrome/browser/extensions/extension_tab_helper.h b/chrome/browser/extensions/extension_tab_helper.h
index 7dda6fff86430968b62e42191f790c1466eb3782..597e9e79084bbf60d7367d49467252bdfba543ee 100644
--- a/chrome/browser/extensions/extension_tab_helper.h
+++ b/chrome/browser/extensions/extension_tab_helper.h
@@ -6,11 +6,13 @@
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_TAB_HELPER_H_
#pragma once
-#include "content/browser/tab_contents/tab_contents_observer.h"
+#include "base/memory/weak_ptr.h"
+#include "chrome/browser/extensions/app_notify_channel_setup.h"
#include "chrome/browser/extensions/extension_function_dispatcher.h"
#include "chrome/browser/extensions/image_loading_tracker.h"
#include "chrome/browser/extensions/webstore_inline_installer.h"
#include "chrome/common/web_apps.h"
+#include "content/browser/tab_contents/tab_contents_observer.h"
#include "third_party/skia/include/core/SkBitmap.h"
class Extension;
@@ -22,10 +24,13 @@ struct LoadCommittedDetails;
}
// Per-tab extension helper. Also handles non-extension apps.
-class ExtensionTabHelper : public TabContentsObserver,
- public ExtensionFunctionDispatcher::Delegate,
- public ImageLoadingTracker::Observer,
- public WebstoreInlineInstaller::Delegate {
+class ExtensionTabHelper
+ : public TabContentsObserver,
+ public ExtensionFunctionDispatcher::Delegate,
+ public ImageLoadingTracker::Observer,
+ public WebstoreInlineInstaller::Delegate,
+ public AppNotifyChannelSetup::Delegate,
+ public base::SupportsWeakPtr<ExtensionTabHelper> {
public:
explicit ExtensionTabHelper(TabContentsWrapper* wrapper);
virtual ~ExtensionTabHelper();
@@ -82,6 +87,11 @@ class ExtensionTabHelper : public TabContentsObserver,
// INVALIDATE_TITLE navigation state change to trigger repaint of title.
void SetAppIcon(const SkBitmap& app_icon);
+ // Implementing the AppNotifyChannelSetup::Delegate interface.
Aaron Boodman 2011/10/06 20:29:28 Note that you can implement interfaces in C++ priv
asargent_no_longer_on_chrome 2011/10/06 22:37:38 Good idea. Done.
+ virtual void AppNotifyChannelSetupComplete(int request_id,
+ const std::string& channel_id,
+ const std::string& error);
+
private:
// TabContentsObserver overrides.
virtual void DidNavigateMainFramePostCommit(
@@ -100,6 +110,9 @@ class ExtensionTabHelper : public TabContentsObserver,
void OnInlineWebstoreInstall(int install_id,
const std::string& webstore_item_id,
const GURL& requestor_url);
+ void OnGetAppNotifyChannel(int request_id,
+ const GURL& requestor_url,
+ const std::string& client_id);
void OnRequest(const ExtensionHostMsg_Request_Params& params);
// App extensions related methods:

Powered by Google App Engine
This is Rietveld 408576698