summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/app_launcher.cc2
-rw-r--r--chrome/browser/views/find_bar_host_interactive_uitest.cc11
-rw-r--r--chrome/browser/views/frame/browser_view.cc2
-rw-r--r--chrome/browser/views/tabs/browser_tab_strip_controller.cc21
-rw-r--r--chrome/browser/views/tabs/browser_tab_strip_controller.h6
5 files changed, 27 insertions, 15 deletions
diff --git a/chrome/browser/views/app_launcher.cc b/chrome/browser/views/app_launcher.cc
index 4fa173d..1b852dc 100644
--- a/chrome/browser/views/app_launcher.cc
+++ b/chrome/browser/views/app_launcher.cc
@@ -388,7 +388,7 @@ void AppLauncher::AddTabWithURL(const GURL& url,
browser_->AddTabWithURL(
url, GURL(), transition, -1,
TabStripModel::ADD_SELECTED | TabStripModel::ADD_FORCE_INDEX, NULL,
- std::string());
+ std::string(), NULL);
}
void AppLauncher::Resize(const gfx::Size& contents_size) {
diff --git a/chrome/browser/views/find_bar_host_interactive_uitest.cc b/chrome/browser/views/find_bar_host_interactive_uitest.cc
index 615008d..991338c 100644
--- a/chrome/browser/views/find_bar_host_interactive_uitest.cc
+++ b/chrome/browser/views/find_bar_host_interactive_uitest.cc
@@ -89,7 +89,8 @@ class FindInPageTest : public InProcessBrowserTest {
} // namespace
IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) {
- scoped_refptr<net::HTTPTestServer> server(net::HTTPTestServer::CreateServer(kDocRoot));
+ scoped_refptr<net::HTTPTestServer> server(
+ net::HTTPTestServer::CreateServer(kDocRoot));
ASSERT_TRUE(NULL != server.get());
// First we navigate to our test page (tab A).
@@ -99,8 +100,11 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) {
browser()->Find();
// Open another tab (tab B).
+ Browser* browser_used = NULL;
browser()->AddTabWithURL(url, GURL(), PageTransition::TYPED, -1,
- TabStripModel::ADD_SELECTED, NULL, std::string());
+ TabStripModel::ADD_SELECTED, NULL, std::string(),
+ &browser_used);
+ EXPECT_EQ(browser(), browser_used);
browser()->Find();
EXPECT_EQ(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD, GetFocusedViewID());
@@ -126,7 +130,8 @@ IN_PROC_BROWSER_TEST_F(FindInPageTest, CrashEscHandlers) {
}
IN_PROC_BROWSER_TEST_F(FindInPageTest, FocusRestore) {
- scoped_refptr<net::HTTPTestServer> server(net::HTTPTestServer::CreateServer(kDocRoot));
+ scoped_refptr<net::HTTPTestServer> server(
+ net::HTTPTestServer::CreateServer(kDocRoot));
ASSERT_TRUE(NULL != server.get());
GURL url = server->TestServerPage("title1.html");
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc
index 85c2d16..daf6b2d 100644
--- a/chrome/browser/views/frame/browser_view.cc
+++ b/chrome/browser/views/frame/browser_view.cc
@@ -1793,7 +1793,7 @@ void BrowserView::InitTabStrip(TabStripModel* model) {
}
BrowserTabStripController* tabstrip_controller =
- new BrowserTabStripController(model);
+ new BrowserTabStripController(browser_.get(), model);
if (UseVerticalTabs())
tabstrip_ = new SideTabStrip(tabstrip_controller);
diff --git a/chrome/browser/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/views/tabs/browser_tab_strip_controller.cc
index 1221133..f0422f1 100644
--- a/chrome/browser/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/views/tabs/browser_tab_strip_controller.cc
@@ -112,9 +112,11 @@ class BrowserTabStripController::TabContextMenuContents
////////////////////////////////////////////////////////////////////////////////
// BrowserTabStripController, public:
-BrowserTabStripController::BrowserTabStripController(TabStripModel* model)
+BrowserTabStripController::BrowserTabStripController(Browser* browser,
+ TabStripModel* model)
: model_(model),
- tabstrip_(NULL) {
+ tabstrip_(NULL),
+ browser_(browser) {
model_->AddObserver(this);
notification_registrar_.Add(this,
@@ -269,12 +271,7 @@ void BrowserTabStripController::CreateNewTab() {
UserMetrics::RecordAction(UserMetricsAction("NewTab_Button"),
model_->profile());
- TabContents* selected_tab = model_->GetSelectedTabContents();
- if (!selected_tab)
- return;
-
- Browser* browser = selected_tab->delegate()->GetBrowser();
- if (browser->OpenAppsPanelAsNewTab())
+ if (browser_ && browser_->OpenAppsPanelAsNewTab())
return;
model_->delegate()->AddBlankTab(true);
@@ -368,7 +365,13 @@ void BrowserTabStripController::SetTabRendererDataFromModel(
TabContents* contents,
int model_index,
TabRendererData* data) {
- SkBitmap* app_icon = contents->GetExtensionAppIcon();
+ SkBitmap* app_icon = NULL;
+
+ // Extension App icons are slightly larger than favicons, so only allow
+ // them if permitted by the model.
+ if (model_->delegate()->LargeIconsPermitted())
+ app_icon = contents->GetExtensionAppIcon();
+
if (app_icon)
data->favicon = *app_icon;
else
diff --git a/chrome/browser/views/tabs/browser_tab_strip_controller.h b/chrome/browser/views/tabs/browser_tab_strip_controller.h
index 662a0c1..e900413 100644
--- a/chrome/browser/views/tabs/browser_tab_strip_controller.h
+++ b/chrome/browser/views/tabs/browser_tab_strip_controller.h
@@ -13,6 +13,7 @@
class BaseTab;
class BaseTabStrip;
+class Browser;
struct TabRendererData;
@@ -22,7 +23,7 @@ class BrowserTabStripController : public TabStripController,
public TabStripModelObserver,
public NotificationObserver {
public:
- explicit BrowserTabStripController(TabStripModel* model);
+ BrowserTabStripController(Browser* browser, TabStripModel* model);
virtual ~BrowserTabStripController();
void InitFromModel(BaseTabStrip* tabstrip);
@@ -104,6 +105,9 @@ class BrowserTabStripController : public TabStripController,
BaseTabStrip* tabstrip_;
+ // Non-owning pointer to the browser which is using this controller.
+ Browser* browser_;
+
// If non-NULL it means we're showing a menu for the tab.
scoped_ptr<TabContextMenuContents> context_menu_contents_;