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

Side by Side Diff: chrome/browser/ui/views/browser_actions_container.cc

Issue 10891044: RestoreTabHelper > SessionTabHelper, move more session stuff into it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/ui/views/browser_actions_container.h" 5 #include "chrome/browser/ui/views/browser_actions_container.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/sessions/restore_tab_helper.h" 11 #include "chrome/browser/sessions/session_tab_helper.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_tabstrip.h" 13 #include "chrome/browser/ui/browser_tabstrip.h"
14 #include "chrome/browser/ui/tab_contents/tab_contents.h" 14 #include "chrome/browser/ui/tab_contents/tab_contents.h"
15 #include "chrome/browser/ui/view_ids.h" 15 #include "chrome/browser/ui/view_ids.h"
16 #include "chrome/browser/ui/views/browser_action_view.h" 16 #include "chrome/browser/ui/views/browser_action_view.h"
17 #include "chrome/browser/ui/views/extensions/browser_action_drag_data.h" 17 #include "chrome/browser/ui/views/extensions/browser_action_drag_data.h"
18 #include "chrome/browser/ui/views/extensions/extension_popup.h" 18 #include "chrome/browser/ui/views/extensions/extension_popup.h"
19 #include "chrome/browser/ui/views/toolbar_view.h" 19 #include "chrome/browser/ui/views/toolbar_view.h"
20 #include "chrome/common/pref_names.h" 20 #include "chrome/common/pref_names.h"
21 #include "grit/generated_resources.h" 21 #include "grit/generated_resources.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 popup_ = NULL; 450 popup_ = NULL;
451 // |popup_button_| is NULL if the extension has been removed. 451 // |popup_button_| is NULL if the extension has been removed.
452 if (popup_button_) { 452 if (popup_button_) {
453 popup_button_->SetButtonNotPushed(); 453 popup_button_->SetButtonNotPushed();
454 popup_button_ = NULL; 454 popup_button_ = NULL;
455 } 455 }
456 } 456 }
457 457
458 int BrowserActionsContainer::GetCurrentTabId() const { 458 int BrowserActionsContainer::GetCurrentTabId() const {
459 TabContents* tab = chrome::GetActiveTabContents(browser_); 459 TabContents* tab = chrome::GetActiveTabContents(browser_);
460 return tab ? tab->restore_tab_helper()->session_id().id() : -1; 460 return tab ? tab->session_tab_helper()->session_id().id() : -1;
461 } 461 }
462 462
463 void BrowserActionsContainer::OnBrowserActionExecuted( 463 void BrowserActionsContainer::OnBrowserActionExecuted(
464 BrowserActionButton* button) { 464 BrowserActionButton* button) {
465 const Extension* extension = button->extension(); 465 const Extension* extension = button->extension();
466 GURL popup_url; 466 GURL popup_url;
467 if (model_->ExecuteBrowserAction(extension, browser_, &popup_url) == 467 if (model_->ExecuteBrowserAction(extension, browser_, &popup_url) ==
468 ExtensionToolbarModel::ACTION_SHOW_POPUP) 468 ExtensionToolbarModel::ACTION_SHOW_POPUP)
469 ShowPopup(button, popup_url); 469 ShowPopup(button, popup_url);
470 } 470 }
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 views::BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? 811 views::BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ?
812 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; 812 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT;
813 popup_ = ExtensionPopup::ShowPopup(popup_url, 813 popup_ = ExtensionPopup::ShowPopup(popup_url,
814 browser_, 814 browser_,
815 reference_view, 815 reference_view,
816 arrow_location); 816 arrow_location);
817 popup_->GetWidget()->AddObserver(this); 817 popup_->GetWidget()->AddObserver(this);
818 popup_button_ = button; 818 popup_button_ = button;
819 popup_button_->SetButtonPushed(); 819 popup_button_->SetButtonPushed();
820 } 820 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents.cc ('k') | chrome/browser/ui/views/select_file_dialog_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698