| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/views/toolbar_view.h" | 5 #include "chrome/browser/views/toolbar_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "chrome/app/chrome_dll_resource.h" | 9 #include "chrome/app/chrome_dll_resource.h" |
| 10 #include "chrome/browser/browser.h" | 10 #include "chrome/browser/browser.h" |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 // ToolbarView, private: | 546 // ToolbarView, private: |
| 547 | 547 |
| 548 int ToolbarView::PopupTopSpacing() const { | 548 int ToolbarView::PopupTopSpacing() const { |
| 549 return GetWindow()->GetNonClientView()->UseNativeFrame() ? | 549 return GetWindow()->GetNonClientView()->UseNativeFrame() ? |
| 550 0 : kPopupTopSpacingNonGlass; | 550 0 : kPopupTopSpacingNonGlass; |
| 551 } | 551 } |
| 552 | 552 |
| 553 void ToolbarView::LoadImages() { | 553 void ToolbarView::LoadImages() { |
| 554 ThemeProvider* tp = GetThemeProvider(); | 554 ThemeProvider* tp = GetThemeProvider(); |
| 555 | 555 |
| 556 SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND); | |
| 557 SkBitmap* background = tp->GetBitmapNamed(IDR_THEME_BUTTON_BACKGROUND); | |
| 558 | |
| 559 back_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_BACK)); | 556 back_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_BACK)); |
| 560 back_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_BACK_H)); | 557 back_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_BACK_H)); |
| 561 back_->SetImage(views::CustomButton::BS_PUSHED, | 558 back_->SetImage(views::CustomButton::BS_PUSHED, |
| 562 tp->GetBitmapNamed(IDR_BACK_P)); | 559 tp->GetBitmapNamed(IDR_BACK_P)); |
| 563 back_->SetImage(views::CustomButton::BS_DISABLED, | 560 back_->SetImage(views::CustomButton::BS_DISABLED, |
| 564 tp->GetBitmapNamed(IDR_BACK_D)); | 561 tp->GetBitmapNamed(IDR_BACK_D)); |
| 565 back_->SetBackground(color, background, | |
| 566 tp->GetBitmapNamed(IDR_BACK_MASK)); | |
| 567 | 562 |
| 568 forward_->SetImage(views::CustomButton::BS_NORMAL, | 563 forward_->SetImage(views::CustomButton::BS_NORMAL, |
| 569 tp->GetBitmapNamed(IDR_FORWARD)); | 564 tp->GetBitmapNamed(IDR_FORWARD)); |
| 570 forward_->SetImage(views::CustomButton::BS_HOT, | 565 forward_->SetImage(views::CustomButton::BS_HOT, |
| 571 tp->GetBitmapNamed(IDR_FORWARD_H)); | 566 tp->GetBitmapNamed(IDR_FORWARD_H)); |
| 572 forward_->SetImage(views::CustomButton::BS_PUSHED, | 567 forward_->SetImage(views::CustomButton::BS_PUSHED, |
| 573 tp->GetBitmapNamed(IDR_FORWARD_P)); | 568 tp->GetBitmapNamed(IDR_FORWARD_P)); |
| 574 forward_->SetImage(views::CustomButton::BS_DISABLED, | 569 forward_->SetImage(views::CustomButton::BS_DISABLED, |
| 575 tp->GetBitmapNamed(IDR_FORWARD_D)); | 570 tp->GetBitmapNamed(IDR_FORWARD_D)); |
| 576 forward_->SetBackground(color, background, | |
| 577 tp->GetBitmapNamed(IDR_FORWARD_MASK)); | |
| 578 | 571 |
| 579 reload_->SetImage(views::CustomButton::BS_NORMAL, | 572 reload_->SetImage(views::CustomButton::BS_NORMAL, |
| 580 tp->GetBitmapNamed(IDR_RELOAD)); | 573 tp->GetBitmapNamed(IDR_RELOAD)); |
| 581 reload_->SetImage(views::CustomButton::BS_HOT, | 574 reload_->SetImage(views::CustomButton::BS_HOT, |
| 582 tp->GetBitmapNamed(IDR_RELOAD_H)); | 575 tp->GetBitmapNamed(IDR_RELOAD_H)); |
| 583 reload_->SetImage(views::CustomButton::BS_PUSHED, | 576 reload_->SetImage(views::CustomButton::BS_PUSHED, |
| 584 tp->GetBitmapNamed(IDR_RELOAD_P)); | 577 tp->GetBitmapNamed(IDR_RELOAD_P)); |
| 585 reload_->SetToggledImage(views::CustomButton::BS_NORMAL, | 578 reload_->SetToggledImage(views::CustomButton::BS_NORMAL, |
| 586 tp->GetBitmapNamed(IDR_STOP)); | 579 tp->GetBitmapNamed(IDR_STOP)); |
| 587 reload_->SetToggledImage(views::CustomButton::BS_HOT, | 580 reload_->SetToggledImage(views::CustomButton::BS_HOT, |
| 588 tp->GetBitmapNamed(IDR_STOP_H)); | 581 tp->GetBitmapNamed(IDR_STOP_H)); |
| 589 reload_->SetToggledImage(views::CustomButton::BS_PUSHED, | 582 reload_->SetToggledImage(views::CustomButton::BS_PUSHED, |
| 590 tp->GetBitmapNamed(IDR_STOP_P)); | 583 tp->GetBitmapNamed(IDR_STOP_P)); |
| 591 reload_->SetBackground(color, background, | |
| 592 tp->GetBitmapNamed(IDR_BUTTON_MASK)); | |
| 593 | 584 |
| 594 home_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_HOME)); | 585 home_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_HOME)); |
| 595 home_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_HOME_H)); | 586 home_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_HOME_H)); |
| 596 home_->SetImage(views::CustomButton::BS_PUSHED, | 587 home_->SetImage(views::CustomButton::BS_PUSHED, |
| 597 tp->GetBitmapNamed(IDR_HOME_P)); | 588 tp->GetBitmapNamed(IDR_HOME_P)); |
| 598 home_->SetBackground(color, background, | |
| 599 tp->GetBitmapNamed(IDR_BUTTON_MASK)); | |
| 600 | 589 |
| 601 app_menu_->SetIcon(GetAppMenuIcon()); | 590 app_menu_->SetIcon(GetAppMenuIcon()); |
| 602 } | 591 } |
| 603 | 592 |
| 604 void ToolbarView::ShowUpgradeReminder() { | 593 void ToolbarView::ShowUpgradeReminder() { |
| 605 update_reminder_animation_.reset(new SlideAnimation(this)); | 594 update_reminder_animation_.reset(new SlideAnimation(this)); |
| 606 update_reminder_animation_->SetSlideDuration(kPulseDuration); | 595 update_reminder_animation_->SetSlideDuration(kPulseDuration); |
| 607 | 596 |
| 608 // Then start the recurring timer for pulsating it. | 597 // Then start the recurring timer for pulsating it. |
| 609 upgrade_reminder_pulse_timer_.Start( | 598 upgrade_reminder_pulse_timer_.Start( |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 *tp->GetBitmapNamed(IDR_UPGRADE_DOT_INACTIVE), | 643 *tp->GetBitmapNamed(IDR_UPGRADE_DOT_INACTIVE), |
| 655 *tp->GetBitmapNamed(IDR_UPGRADE_DOT_ACTIVE), | 644 *tp->GetBitmapNamed(IDR_UPGRADE_DOT_ACTIVE), |
| 656 value); | 645 value); |
| 657 } | 646 } |
| 658 | 647 |
| 659 canvas->DrawBitmapInt(badge, kUpgradeDotOffset, | 648 canvas->DrawBitmapInt(badge, kUpgradeDotOffset, |
| 660 icon.height() - badge.height()); | 649 icon.height() - badge.height()); |
| 661 | 650 |
| 662 return canvas->ExtractBitmap(); | 651 return canvas->ExtractBitmap(); |
| 663 } | 652 } |
| OLD | NEW |