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

Unified Diff: chrome/browser/views/tabs/tab_renderer.cc

Issue 115740: Move download shelf from per-tab to per-window (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/tabs/tab_renderer.h ('k') | chrome/common/temp_scaffolding_stubs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/tabs/tab_renderer.cc
===================================================================
--- chrome/browser/views/tabs/tab_renderer.cc (revision 17483)
+++ chrome/browser/views/tabs/tab_renderer.cc (working copy)
@@ -65,9 +65,6 @@
static int loading_animation_frame_count = 0;
static int waiting_animation_frame_count = 0;
static int waiting_to_loading_frame_count_ratio = 0;
-static SkBitmap* download_icon = NULL;
-static int download_icon_width = 0;
-static int download_icon_height = 0;
TabRenderer::TabImage TabRenderer::tab_alpha = {0};
TabRenderer::TabImage TabRenderer::tab_active = {0};
@@ -138,10 +135,6 @@
crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON);
- download_icon = rb.GetBitmapNamed(IDR_DOWNLOAD_ICON);
- download_icon_width = download_icon->width();
- download_icon_height = download_icon->height();
-
initialized = true;
}
}
@@ -237,7 +230,6 @@
: animation_state_(ANIMATION_NONE),
animation_frame_(0),
showing_icon_(false),
- showing_download_icon_(false),
showing_close_button_(false),
fav_icon_hiding_offset_(0),
crash_animation_(NULL),
@@ -286,7 +278,6 @@
if (!loading_only) {
data_.title = UTF16ToWideHack(contents->GetTitle());
data_.off_the_record = contents->profile()->IsOffTheRecord();
- data_.show_download_icon = contents->IsDownloadShelfVisible();
data_.crashed = contents->is_crashed();
data_.favicon = contents->GetFavIcon();
}
@@ -400,10 +391,8 @@
// See if the model changes whether the icons should be painted.
const bool show_icon = ShouldShowIcon();
- const bool show_download_icon = data_.show_download_icon;
const bool show_close_button = ShouldShowCloseBox();
if (show_icon != showing_icon_ ||
- show_download_icon != showing_download_icon_ ||
show_close_button != showing_close_button_)
Layout();
@@ -442,11 +431,6 @@
}
}
- if (show_download_icon) {
- canvas->DrawBitmapInt(*download_icon,
- download_icon_bounds_.x(), download_icon_bounds_.y());
- }
-
// Paint the Title.
std::wstring title = data_.title;
if (title.empty()) {
@@ -487,14 +471,6 @@
favicon_bounds_.SetRect(lb.x(), lb.y(), 0, 0);
}
- // Size the download icon.
- showing_download_icon_ = data_.show_download_icon;
- if (showing_download_icon_) {
- int icon_top = kTopPadding + (content_height - download_icon_height) / 2;
- download_icon_bounds_.SetRect(lb.width() - download_icon_width, icon_top,
- download_icon_width, download_icon_height);
- }
-
// Size the Close button.
showing_close_button_ = ShouldShowCloseBox();
if (showing_close_button_) {
@@ -530,21 +506,17 @@
} else {
title_width = std::max(lb.width() - title_left, 0);
}
- if (data_.show_download_icon)
- title_width = std::max(title_width - download_icon_width, 0);
title_bounds_.SetRect(title_left, title_top, title_width, title_font_height);
- // Certain UI elements within the Tab (the favicon, the download icon, etc.)
- // are not represented as child Views (which is the preferred method).
- // Instead, these UI elements are drawn directly on the canvas from within
- // Tab::Paint(). The Tab's child Views (for example, the Tab's close button
- // which is a views::Button instance) are automatically mirrored by the
- // mirroring infrastructure in views. The elements Tab draws directly
- // on the canvas need to be manually mirrored if the View's layout is
- // right-to-left.
+ // Certain UI elements within the Tab (the favicon, etc.) are not represented
+ // as child Views (which is the preferred method). Instead, these UI elements
+ // are drawn directly on the canvas from within Tab::Paint(). The Tab's child
+ // Views (for example, the Tab's close button which is a views::Button
+ // instance) are automatically mirrored by the mirroring infrastructure in
+ // views. The elements Tab draws directly on the canvas need to be manually
+ // mirrored if the View's layout is right-to-left.
favicon_bounds_.set_x(MirroredLeftPointForRect(favicon_bounds_));
title_bounds_.set_x(MirroredLeftPointForRect(title_bounds_));
- download_icon_bounds_.set_x(MirroredLeftPointForRect(download_icon_bounds_));
}
void TabRenderer::OnMouseEntered(const views::MouseEvent& e) {
« no previous file with comments | « chrome/browser/views/tabs/tab_renderer.h ('k') | chrome/common/temp_scaffolding_stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698