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

Unified Diff: trunk/src/chrome/browser/ui/views/toolbar/toolbar_view.cc

Issue 98493004: Revert 238732 "[SiteChip] Add the basic painting of the site chi..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/chrome/browser/ui/views/toolbar/toolbar_view.h ('k') | trunk/src/chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/browser/ui/views/toolbar/toolbar_view.cc
===================================================================
--- trunk/src/chrome/browser/ui/views/toolbar/toolbar_view.cc (revision 238753)
+++ trunk/src/chrome/browser/ui/views/toolbar/toolbar_view.cc (working copy)
@@ -37,7 +37,6 @@
#include "chrome/browser/ui/views/toolbar/browser_actions_container.h"
#include "chrome/browser/ui/views/toolbar/home_button.h"
#include "chrome/browser/ui/views/toolbar/reload_button.h"
-#include "chrome/browser/ui/views/toolbar/site_chip_view.h"
#include "chrome/browser/ui/views/toolbar/toolbar_button.h"
#include "chrome/browser/ui/views/toolbar/wrench_menu.h"
#include "chrome/browser/ui/views/toolbar/wrench_toolbar_button.h"
@@ -122,7 +121,6 @@
reload_(NULL),
home_(NULL),
location_bar_(NULL),
- site_chip_view_(NULL),
browser_actions_(NULL),
app_menu_(NULL),
browser_(browser) {
@@ -229,9 +227,6 @@
AddChildView(reload_);
AddChildView(home_);
AddChildView(location_bar_);
- site_chip_view_ = new SiteChipView(this);
- if (site_chip_view_->ShouldShow())
- AddChildView(site_chip_view_);
AddChildView(browser_actions_);
AddChildView(app_menu_);
@@ -243,7 +238,6 @@
UpdateAppMenuState();
location_bar_->Init();
- site_chip_view_->Init();
show_home_button_.Init(prefs::kShowHomeButton,
browser_->profile()->GetPrefs(),
base::Bind(&ToolbarView::OnShowHomeButtonChanged,
@@ -272,8 +266,6 @@
void ToolbarView::Update(WebContents* tab) {
if (location_bar_)
location_bar_->Update(tab);
- if (site_chip_view_->ShouldShow())
- site_chip_view_->Update(tab);
if (browser_actions_)
browser_actions_->RefreshBrowserActionViews();
@@ -495,10 +487,6 @@
(show_home_button_.GetValue() ?
(home_->GetPreferredSize().width() + button_spacing) : 0) +
location_bar_->GetPreferredSize().width() +
- (site_chip_view_->ShouldShow() ?
- (site_chip_view_->GetPreferredSize().width() +
- 2 * kStandardSpacing + 2 * button_spacing) :
- 0) +
browser_actions_->GetPreferredSize().width() +
app_menu_->GetPreferredSize().width() + kRightEdgeSpacing;
gfx::ImageSkia* normal_background =
@@ -568,41 +556,18 @@
}
int browser_actions_width = browser_actions_->GetPreferredSize().width();
-
- // Note: spacing from location bar to site chip is 1 pixel less than
- // kStandardSpacing given the edge thickness of the chip.
- int site_chip_width =
- (site_chip_view_->ShouldShow() ?
- site_chip_view_->GetPreferredSize().width() +
- kStandardSpacing : 0);
int app_menu_width = app_menu_->GetPreferredSize().width();
int location_x = home_->x() + home_->width() + kStandardSpacing;
int available_width = std::max(0, width() - kRightEdgeSpacing -
app_menu_width - browser_actions_width - location_x);
- // Cap site chip width at 1/2 the size available to the location bar.
- site_chip_width = std::min(site_chip_width, available_width / 2);
- available_width -= site_chip_width;
-
int location_height = location_bar_->GetPreferredSize().height();
int location_y = (height() - location_height + 1) / 2;
location_bar_->SetBounds(location_x, location_y, std::max(available_width, 0),
location_height);
- int browser_actions_x = location_bar_->x() + location_bar_->width();
-
- if (site_chip_view_->ShouldShow()) {
- site_chip_view_->SetBounds(browser_actions_x + kStandardSpacing,
- child_y,
- site_chip_view_->GetPreferredSize().width(),
- child_height);
- browser_actions_x +=
- site_chip_view_->GetPreferredSize().width() + kStandardSpacing;
- }
-
- browser_actions_->SetBounds(browser_actions_x, 0,
+ browser_actions_->SetBounds(location_bar_->x() + location_bar_->width(), 0,
browser_actions_width, height());
-
// The browser actions need to do a layout explicitly, because when an
// extension is loaded/unloaded/changed, BrowserActionContainer removes and
// re-adds everything, regardless of whether it has a page action. For a
« no previous file with comments | « trunk/src/chrome/browser/ui/views/toolbar/toolbar_view.h ('k') | trunk/src/chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698