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

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

Issue 10912156: Move SessionID, CaptureVisibleTabFunction to WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase atop the extension tab helper change Created 8 years, 3 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/page_action_controller.h" 5 #include "chrome/browser/extensions/page_action_controller.h"
6 6
7 #include "chrome/browser/extensions/browser_event_router.h" 7 #include "chrome/browser/extensions/browser_event_router.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/browser/extensions/tab_helper.h" 10 #include "chrome/browser/extensions/tab_helper.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 const content::LoadCommittedDetails& details, 87 const content::LoadCommittedDetails& details,
88 const content::FrameNavigateParams& params) { 88 const content::FrameNavigateParams& params) {
89 if (details.is_in_page) 89 if (details.is_in_page)
90 return; 90 return;
91 91
92 const std::vector<ExtensionAction*> current_actions = GetCurrentActions(); 92 const std::vector<ExtensionAction*> current_actions = GetCurrentActions();
93 93
94 if (current_actions.empty()) 94 if (current_actions.empty())
95 return; 95 return;
96 96
97 TabContents* tab_contents = TabContents::FromWebContents(web_contents());
98 for (size_t i = 0; i < current_actions.size(); ++i) { 97 for (size_t i = 0; i < current_actions.size(); ++i) {
99 current_actions[i]->ClearAllValuesForTab( 98 current_actions[i]->ClearAllValuesForTab(
100 SessionID::IdForTab(tab_contents)); 99 SessionID::IdForTab(web_contents()));
101 } 100 }
102 101
103 NotifyChange(); 102 NotifyChange();
104 } 103 }
105 104
106 ExtensionService* PageActionController::GetExtensionService() const { 105 ExtensionService* PageActionController::GetExtensionService() const {
107 TabContents* tab_contents = TabContents::FromWebContents(web_contents()); 106 TabContents* tab_contents = TabContents::FromWebContents(web_contents());
108 return ExtensionSystem::Get(tab_contents->profile())->extension_service(); 107 return ExtensionSystem::Get(tab_contents->profile())->extension_service();
109 } 108 }
110 109
111 } // namespace extensions 110 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_tab_util.cc ('k') | chrome/browser/extensions/page_action_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698