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

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

Issue 10540100: TabContentsWrapper -> TabContents, part 48. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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/restore_tab_helper.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 13 #include "chrome/browser/ui/tab_contents/tab_contents.h"
14 #include "chrome/browser/ui/view_ids.h" 14 #include "chrome/browser/ui/view_ids.h"
15 #include "chrome/browser/ui/views/browser_action_view.h" 15 #include "chrome/browser/ui/views/browser_action_view.h"
16 #include "chrome/browser/ui/views/extensions/browser_action_drag_data.h" 16 #include "chrome/browser/ui/views/extensions/browser_action_drag_data.h"
17 #include "chrome/browser/ui/views/extensions/extension_popup.h" 17 #include "chrome/browser/ui/views/extensions/extension_popup.h"
18 #include "chrome/browser/ui/views/toolbar_view.h" 18 #include "chrome/browser/ui/views/toolbar_view.h"
19 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
20 #include "grit/generated_resources.h" 20 #include "grit/generated_resources.h"
21 #include "grit/theme_resources.h" 21 #include "grit/theme_resources.h"
22 #include "grit/theme_resources_standard.h" 22 #include "grit/theme_resources_standard.h"
23 #include "grit/ui_resources.h" 23 #include "grit/ui_resources.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 int predefined_width = 121 int predefined_width =
122 profile_->GetPrefs()->GetInteger(prefs::kBrowserActionContainerWidth); 122 profile_->GetPrefs()->GetInteger(prefs::kBrowserActionContainerWidth);
123 if (predefined_width != 0) 123 if (predefined_width != 0)
124 model_->SetVisibleIconCount(WidthToIconCount(predefined_width)); 124 model_->SetVisibleIconCount(WidthToIconCount(predefined_width));
125 } 125 }
126 if (model_ && model_->extensions_initialized()) 126 if (model_ && model_->extensions_initialized())
127 SetContainerWidth(); 127 SetContainerWidth();
128 } 128 }
129 129
130 int BrowserActionsContainer::GetCurrentTabId() const { 130 int BrowserActionsContainer::GetCurrentTabId() const {
131 TabContentsWrapper* tab = browser_->GetSelectedTabContentsWrapper(); 131 TabContents* tab = browser_->GetActiveTabContents();
132 return tab ? tab->restore_tab_helper()->session_id().id() : -1; 132 return tab ? tab->restore_tab_helper()->session_id().id() : -1;
133 } 133 }
134 134
135 BrowserActionView* BrowserActionsContainer::GetBrowserActionView( 135 BrowserActionView* BrowserActionsContainer::GetBrowserActionView(
136 ExtensionAction* action) { 136 ExtensionAction* action) {
137 for (BrowserActionViews::iterator iter = browser_action_views_.begin(); 137 for (BrowserActionViews::iterator iter = browser_action_views_.begin();
138 iter != browser_action_views_.end(); ++iter) { 138 iter != browser_action_views_.end(); ++iter) {
139 if ((*iter)->button()->browser_action() == action) 139 if ((*iter)->button()->browser_action() == action)
140 return *iter; 140 return *iter;
141 } 141 }
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
806 views::BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ? 806 views::BubbleBorder::ArrowLocation arrow_location = base::i18n::IsRTL() ?
807 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT; 807 views::BubbleBorder::TOP_LEFT : views::BubbleBorder::TOP_RIGHT;
808 popup_ = ExtensionPopup::ShowPopup(popup_url, 808 popup_ = ExtensionPopup::ShowPopup(popup_url,
809 browser_, 809 browser_,
810 reference_view, 810 reference_view,
811 arrow_location); 811 arrow_location);
812 popup_->GetWidget()->AddObserver(this); 812 popup_->GetWidget()->AddObserver(this);
813 popup_button_ = button; 813 popup_button_ = button;
814 popup_button_->SetButtonPushed(); 814 popup_button_->SetButtonPushed();
815 } 815 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc ('k') | chrome/browser/ui/views/browser_dialogs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698