diff options
author | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-17 08:37:54 +0000 |
---|---|---|
committer | jyasskin@chromium.org <jyasskin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-17 08:37:54 +0000 |
commit | 1034cb4068d0a90f7342113ae94e3fc1047bfcef (patch) | |
tree | 48d51c5b32120949b0bb13dcd097e41bcd4140fe /chrome/browser/extensions/script_badge_controller.cc | |
parent | fb2a5673c45ffbe71263c6c7cb50fdc57b7dc4aa (diff) | |
download | chromium_src-1034cb4068d0a90f7342113ae94e3fc1047bfcef.zip chromium_src-1034cb4068d0a90f7342113ae94e3fc1047bfcef.tar.gz chromium_src-1034cb4068d0a90f7342113ae94e3fc1047bfcef.tar.bz2 |
Add SessionID::{IdForTab,IdForWindowContainingTab}.
The chain of calls IdForTab is an abbreviation for appears ~17 times, some of
which are their own abbreviations:
http://code.google.com/searchframe#search/&exact_package=chromium&q=%22restore_tab_helper()-%3Esession_id().id()%22
Currently, they're still implemented in terms of the restore_tab_helper, but since tab and window IDs are more fundamental than session restore nowadays, it would be possible to change that if the dependency becomes awkward.
Review URL: https://chromiumcodereview.appspot.com/10680005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/script_badge_controller.cc')
-rw-r--r-- | chrome/browser/extensions/script_badge_controller.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/extensions/script_badge_controller.cc b/chrome/browser/extensions/script_badge_controller.cc index f1c3673..0400f58 100644 --- a/chrome/browser/extensions/script_badge_controller.cc +++ b/chrome/browser/extensions/script_badge_controller.cc @@ -8,6 +8,7 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_system.h" #include "chrome/browser/extensions/tab_helper.h" +#include "chrome/browser/sessions/session_id.h" #include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/common/extensions/extension.h" #include "chrome/common/extensions/extension_action.h" @@ -49,8 +50,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 - script_badge->SetIsVisible( - tab_contents_->extension_tab_helper()->tab_id(), true); + script_badge->SetIsVisible(SessionID::IdForTab(tab_contents_), true); NotifyChange(); } @@ -79,7 +79,7 @@ LocationBarController::Action ScriptBadgeController::OnClicked( GetExtensionService()->browser_event_router()->ScriptBadgeExecuted( tab_contents_->profile(), *script_badge, - tab_contents_->extension_tab_helper()->tab_id()); + SessionID::IdForTab(tab_contents_)); return ACTION_NONE; case 3: // right return extension->ShowConfigureContextMenus() ? @@ -185,8 +185,8 @@ bool ScriptBadgeController::MarkExtensionExecuting( if (!script_badge) return false; - script_badge->RunIconAnimation( - tab_contents_->extension_tab_helper()->tab_id()); + script_badge->RunIconAnimation(SessionID::IdForTab(tab_contents_)); + return true; } |