Index: chrome/browser/ui/views/browser_actions_container.cc |
diff --git a/chrome/browser/ui/views/browser_actions_container.cc b/chrome/browser/ui/views/browser_actions_container.cc |
index eab721e90e9d2e8a4b78b715fde6be620026db65..9b47b7e37ae33f745a561c67303e9cf4c849978e 100644 |
--- a/chrome/browser/ui/views/browser_actions_container.cc |
+++ b/chrome/browser/ui/views/browser_actions_container.cc |
@@ -127,11 +127,6 @@ void BrowserActionsContainer::Init() { |
SetContainerWidth(); |
} |
-int BrowserActionsContainer::GetCurrentTabId() const { |
- TabContents* tab = chrome::GetActiveTabContents(browser_); |
- return tab ? tab->restore_tab_helper()->session_id().id() : -1; |
-} |
- |
BrowserActionView* BrowserActionsContainer::GetBrowserActionView( |
ExtensionAction* action) { |
for (BrowserActionViews::iterator i(browser_action_views_.begin()); |
@@ -168,12 +163,6 @@ void BrowserActionsContainer::DeleteBrowserActionViews() { |
STLDeleteElements(&browser_action_views_); |
} |
-void BrowserActionsContainer::OnBrowserActionVisibilityChanged() { |
- SetVisible(!browser_action_views_.empty()); |
- owner_view_->Layout(); |
- owner_view_->SchedulePaint(); |
-} |
- |
size_t BrowserActionsContainer::VisibleBrowserActions() const { |
size_t visible_actions = 0; |
for (size_t i = 0; i < browser_action_views_.size(); ++i) { |
@@ -183,19 +172,6 @@ size_t BrowserActionsContainer::VisibleBrowserActions() const { |
return visible_actions; |
} |
-void BrowserActionsContainer::OnBrowserActionExecuted( |
- BrowserActionButton* button) { |
- const Extension* extension = button->extension(); |
- GURL popup_url; |
- switch (model_->ExecuteBrowserAction(extension, browser_, &popup_url)) { |
- case ExtensionToolbarModel::ACTION_NONE: |
- break; |
- case ExtensionToolbarModel::ACTION_SHOW_POPUP: |
- ShowPopup(button, popup_url); |
- break; |
- } |
-} |
- |
gfx::Size BrowserActionsContainer::GetPreferredSize() { |
if (browser_action_views_.empty()) |
return gfx::Size(ToolbarView::kStandardSpacing, 0); |
@@ -477,6 +453,38 @@ void BrowserActionsContainer::OnWidgetClosing(views::Widget* widget) { |
} |
} |
+Browser* BrowserActionsContainer::GetBrowser() const { |
+ return browser_; |
+} |
+ |
+int BrowserActionsContainer::GetCurrentTabId() const { |
+ TabContents* tab = chrome::GetActiveTabContents(browser_); |
+ return tab ? tab->restore_tab_helper()->session_id().id() : -1; |
+} |
+ |
+void BrowserActionsContainer::OnBrowserActionExecuted( |
+ BrowserActionButton* button) { |
+ const Extension* extension = button->extension(); |
+ GURL popup_url; |
+ switch (model_->ExecuteBrowserAction(extension, browser_, &popup_url)) { |
Peter Kasting
2012/07/18 01:37:25
Nit: Why not just:
if (model_->ExecuteBrowserAc
yefimt
2012/07/18 23:18:13
I just moved this function to match h file order,
Peter Kasting
2012/07/19 04:27:31
Consider this a suggestion to go ahead and change
yefimt
2012/07/19 20:00:15
Done.
|
+ case ExtensionToolbarModel::ACTION_NONE: |
+ break; |
+ case ExtensionToolbarModel::ACTION_SHOW_POPUP: |
+ ShowPopup(button, popup_url); |
+ break; |
+ } |
+} |
+ |
+void BrowserActionsContainer::OnBrowserActionVisibilityChanged() { |
+ SetVisible(!browser_action_views_.empty()); |
+ owner_view_->Layout(); |
+ owner_view_->SchedulePaint(); |
+} |
+ |
+gfx::Size BrowserActionsContainer::GetViewContentOffset() const { |
+ return gfx::Size(0, ToolbarView::kVertSpacing); |
+} |
+ |
void BrowserActionsContainer::MoveBrowserAction(const std::string& extension_id, |
size_t new_index) { |
ExtensionService* service = profile_->GetExtensionService(); |