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

Unified Diff: chrome/browser/extensions/script_badge_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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/script_badge_controller.cc
diff --git a/chrome/browser/extensions/script_badge_controller.cc b/chrome/browser/extensions/script_badge_controller.cc
index db573ab74584cf4f31bb131e0fc59c6939f5a9b3..111384a7172f9dd6c543c44475d112f667df6d99 100644
--- a/chrome/browser/extensions/script_badge_controller.cc
+++ b/chrome/browser/extensions/script_badge_controller.cc
@@ -55,8 +55,7 @@ void ScriptBadgeController::GetAttentionFor(
// TODO(jyasskin): Modify the icon's appearance to indicate that the
// extension is merely asking for permission to run:
// http://crbug.com/133142
- TabContents* tab_contents = TabContents::FromWebContents(web_contents());
- script_badge->SetAppearance(SessionID::IdForTab(tab_contents),
+ script_badge->SetAppearance(SessionID::IdForTab(web_contents()),
ExtensionAction::WANTS_ATTENTION);
NotifyChange();
@@ -84,7 +83,7 @@ LocationBarController::Action ScriptBadgeController::OnClicked(
// run script on the page, we want to help users associate clicking with
// the extension having permission to modify the page, so we make the icon
// full-colored immediately.
- if (script_badge->SetAppearance(SessionID::IdForTab(tab_contents),
+ if (script_badge->SetAppearance(SessionID::IdForTab(web_contents()),
ExtensionAction::ACTIVE))
NotifyChange();
@@ -92,7 +91,7 @@ LocationBarController::Action ScriptBadgeController::OnClicked(
GetExtensionService()->browser_event_router()->ScriptBadgeExecuted(
tab_contents->profile(),
*script_badge,
- SessionID::IdForTab(tab_contents));
+ SessionID::IdForTab(web_contents()));
// TODO(jyasskin): The fallback order should be user-defined popup ->
// onClicked handler -> default popup.
@@ -248,8 +247,7 @@ bool ScriptBadgeController::MarkExtensionExecuting(
if (!script_badge)
return false;
- TabContents* tab_contents = TabContents::FromWebContents(web_contents());
- script_badge->SetAppearance(SessionID::IdForTab(tab_contents),
+ script_badge->SetAppearance(SessionID::IdForTab(web_contents()),
ExtensionAction::ACTIVE);
return true;
}
« no previous file with comments | « chrome/browser/extensions/page_action_controller_unittest.cc ('k') | chrome/browser/extensions/tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698