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

Side by Side Diff: chrome/browser/ui/views/download/download_shelf_view.cc

Issue 12634025: Inconsistent use of [x] close panel icon (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_173251
Patch Set: Fixed compile on linux, mac and win Created 7 years, 9 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
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/download/download_shelf_view.h" 5 #include "chrome/browser/ui/views/download/download_shelf_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
313 arrow_image_->SetImage(rb.GetImageSkiaNamed(IDR_DOWNLOADS_FAVICON)); 313 arrow_image_->SetImage(rb.GetImageSkiaNamed(IDR_DOWNLOADS_FAVICON));
314 AddChildView(arrow_image_); 314 AddChildView(arrow_image_);
315 315
316 show_all_view_ = new views::Link( 316 show_all_view_ = new views::Link(
317 l10n_util::GetStringUTF16(IDS_SHOW_ALL_DOWNLOADS)); 317 l10n_util::GetStringUTF16(IDS_SHOW_ALL_DOWNLOADS));
318 show_all_view_->set_listener(this); 318 show_all_view_->set_listener(this);
319 AddChildView(show_all_view_); 319 AddChildView(show_all_view_);
320 320
321 close_button_ = new views::ImageButton(this); 321 close_button_ = new views::ImageButton(this);
322 close_button_->SetImage(views::CustomButton::STATE_NORMAL, 322 close_button_->SetImage(views::CustomButton::STATE_NORMAL,
323 rb.GetImageSkiaNamed(IDR_CLOSE_BAR)); 323 rb.GetImageSkiaNamed(IDR_CLOSE_1));
324 close_button_->SetImage(views::CustomButton::STATE_HOVERED, 324 close_button_->SetImage(views::CustomButton::STATE_HOVERED,
325 rb.GetImageSkiaNamed(IDR_CLOSE_BAR_H)); 325 rb.GetImageSkiaNamed(IDR_CLOSE_1_H));
326 close_button_->SetImage(views::CustomButton::STATE_PRESSED, 326 close_button_->SetImage(views::CustomButton::STATE_PRESSED,
327 rb.GetImageSkiaNamed(IDR_CLOSE_BAR_P)); 327 rb.GetImageSkiaNamed(IDR_CLOSE_1_P));
328 close_button_->SetAccessibleName( 328 close_button_->SetAccessibleName(
329 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); 329 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
330 AddChildView(close_button_); 330 AddChildView(close_button_);
331 331
332 UpdateColorsFromTheme(); 332 UpdateColorsFromTheme();
333 333
334 new_item_animation_.reset(new ui::SlideAnimation(this)); 334 new_item_animation_.reset(new ui::SlideAnimation(this));
335 new_item_animation_->SetSlideDuration(kNewItemAnimationDurationMs); 335 new_item_animation_->SetSlideDuration(kNewItemAnimationDurationMs);
336 336
337 shelf_animation_.reset(new ui::SlideAnimation(this)); 337 shelf_animation_.reset(new ui::SlideAnimation(this));
(...skipping 25 matching lines...) Expand all
363 void DownloadShelfView::UpdateColorsFromTheme() { 363 void DownloadShelfView::UpdateColorsFromTheme() {
364 if (show_all_view_ && close_button_ && GetThemeProvider()) { 364 if (show_all_view_ && close_button_ && GetThemeProvider()) {
365 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 365 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
366 set_background(views::Background::CreateSolidBackground( 366 set_background(views::Background::CreateSolidBackground(
367 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR))); 367 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR)));
368 show_all_view_->SetBackgroundColor(background()->get_color()); 368 show_all_view_->SetBackgroundColor(background()->get_color());
369 show_all_view_->SetEnabledColor( 369 show_all_view_->SetEnabledColor(
370 GetThemeProvider()->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT)); 370 GetThemeProvider()->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT));
371 close_button_->SetBackground( 371 close_button_->SetBackground(
372 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT), 372 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT),
373 rb.GetImageSkiaNamed(IDR_CLOSE_BAR), 373 rb.GetImageSkiaNamed(IDR_CLOSE_1),
374 rb.GetImageSkiaNamed(IDR_CLOSE_BAR_MASK)); 374 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK));
375 } 375 }
376 } 376 }
377 377
378 void DownloadShelfView::OnThemeChanged() { 378 void DownloadShelfView::OnThemeChanged() {
379 UpdateColorsFromTheme(); 379 UpdateColorsFromTheme();
380 } 380 }
381 381
382 void DownloadShelfView::LinkClicked(views::Link* source, int event_flags) { 382 void DownloadShelfView::LinkClicked(views::Link* source, int event_flags) {
383 chrome::ShowDownloads(browser_); 383 chrome::ShowDownloads(browser_);
384 } 384 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 const DownloadItemView* download_item_view) { 473 const DownloadItemView* download_item_view) {
474 gfx::Rect bounds = download_item_view->bounds(); 474 gfx::Rect bounds = download_item_view->bounds();
475 475
476 #if defined(TOOLKIT_VIEWS) 476 #if defined(TOOLKIT_VIEWS)
477 bounds.set_height(bounds.height() - 1); 477 bounds.set_height(bounds.height() - 1);
478 bounds.Offset(0, 3); 478 bounds.Offset(0, 3);
479 #endif 479 #endif
480 480
481 return bounds; 481 return bounds;
482 } 482 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698