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

Side by Side Diff: chrome/browser/extensions/tab_helper.cc

Issue 10993064: Make using WebContentsUserData simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/tab_helper.h" 5 #include "chrome/browser/extensions/tab_helper.h"
6 6
7 #include "chrome/browser/extensions/activity_log.h" 7 #include "chrome/browser/extensions/activity_log.h"
8 #include "chrome/browser/extensions/app_notify_channel_ui.h" 8 #include "chrome/browser/extensions/app_notify_channel_ui.h"
9 #include "chrome/browser/extensions/crx_installer.h" 9 #include "chrome/browser/extensions/crx_installer.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 27 matching lines...) Expand all
38 #include "content/public/browser/render_widget_host_view.h" 38 #include "content/public/browser/render_widget_host_view.h"
39 #include "content/public/browser/web_contents.h" 39 #include "content/public/browser/web_contents.h"
40 #include "content/public/browser/web_contents_view.h" 40 #include "content/public/browser/web_contents_view.h"
41 #include "ui/gfx/image/image.h" 41 #include "ui/gfx/image/image.h"
42 42
43 using content::NavigationController; 43 using content::NavigationController;
44 using content::NavigationEntry; 44 using content::NavigationEntry;
45 using content::RenderViewHost; 45 using content::RenderViewHost;
46 using content::WebContents; 46 using content::WebContents;
47 47
48 DEFINE_WEB_CONTENTS_USER_DATA_KEY(extensions::TabHelper)
49
48 namespace { 50 namespace {
49 51
50 const char kPermissionError[] = "permission_error"; 52 const char kPermissionError[] = "permission_error";
51 53
52 } // namespace 54 } // namespace
53 55
54 namespace extensions { 56 namespace extensions {
55 57
56 int TabHelper::kUserDataKey;
57
58 TabHelper::ContentScriptObserver::ContentScriptObserver(TabHelper* tab_helper) 58 TabHelper::ContentScriptObserver::ContentScriptObserver(TabHelper* tab_helper)
59 : tab_helper_(tab_helper) { 59 : tab_helper_(tab_helper) {
60 tab_helper_->AddContentScriptObserver(this); 60 tab_helper_->AddContentScriptObserver(this);
61 } 61 }
62 62
63 TabHelper::ContentScriptObserver::ContentScriptObserver() : tab_helper_(NULL) { 63 TabHelper::ContentScriptObserver::ContentScriptObserver() : tab_helper_(NULL) {
64 } 64 }
65 65
66 TabHelper::ContentScriptObserver::~ContentScriptObserver() { 66 TabHelper::ContentScriptObserver::~ContentScriptObserver() {
67 if (tab_helper_) 67 if (tab_helper_)
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 // malware site etc). When this happens, we abort the shortcut update. 486 // malware site etc). When this happens, we abort the shortcut update.
487 NavigationEntry* entry = controller.GetLastCommittedEntry(); 487 NavigationEntry* entry = controller.GetLastCommittedEntry();
488 if (entry) 488 if (entry)
489 GetApplicationInfo(entry->GetPageID()); 489 GetApplicationInfo(entry->GetPageID());
490 else 490 else
491 pending_web_app_action_ = NONE; 491 pending_web_app_action_ = NONE;
492 } 492 }
493 } 493 }
494 494
495 } // namespace extensions 495 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698