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 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 // ToolbarView, private: | 527 // ToolbarView, private: |
528 | 528 |
529 int ToolbarView::PopupTopSpacing() const { | 529 int ToolbarView::PopupTopSpacing() const { |
530 return GetWindow()->GetNonClientView()->UseNativeFrame() ? | 530 return GetWindow()->GetNonClientView()->UseNativeFrame() ? |
531 0 : kPopupTopSpacingNonGlass; | 531 0 : kPopupTopSpacingNonGlass; |
532 } | 532 } |
533 | 533 |
534 void ToolbarView::LoadImages() { | 534 void ToolbarView::LoadImages() { |
535 ThemeProvider* tp = GetThemeProvider(); | 535 ThemeProvider* tp = GetThemeProvider(); |
536 | 536 |
537 SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND); | |
538 SkBitmap* background = tp->GetBitmapNamed(IDR_THEME_BUTTON_BACKGROUND); | |
539 | |
540 back_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_BACK)); | 537 back_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_BACK)); |
541 back_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_BACK_H)); | 538 back_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_BACK_H)); |
542 back_->SetImage(views::CustomButton::BS_PUSHED, | 539 back_->SetImage(views::CustomButton::BS_PUSHED, |
543 tp->GetBitmapNamed(IDR_BACK_P)); | 540 tp->GetBitmapNamed(IDR_BACK_P)); |
544 back_->SetImage(views::CustomButton::BS_DISABLED, | 541 back_->SetImage(views::CustomButton::BS_DISABLED, |
545 tp->GetBitmapNamed(IDR_BACK_D)); | 542 tp->GetBitmapNamed(IDR_BACK_D)); |
546 back_->SetBackground(color, background, | |
547 tp->GetBitmapNamed(IDR_BACK_MASK)); | |
548 | 543 |
549 forward_->SetImage(views::CustomButton::BS_NORMAL, | 544 forward_->SetImage(views::CustomButton::BS_NORMAL, |
550 tp->GetBitmapNamed(IDR_FORWARD)); | 545 tp->GetBitmapNamed(IDR_FORWARD)); |
551 forward_->SetImage(views::CustomButton::BS_HOT, | 546 forward_->SetImage(views::CustomButton::BS_HOT, |
552 tp->GetBitmapNamed(IDR_FORWARD_H)); | 547 tp->GetBitmapNamed(IDR_FORWARD_H)); |
553 forward_->SetImage(views::CustomButton::BS_PUSHED, | 548 forward_->SetImage(views::CustomButton::BS_PUSHED, |
554 tp->GetBitmapNamed(IDR_FORWARD_P)); | 549 tp->GetBitmapNamed(IDR_FORWARD_P)); |
555 forward_->SetImage(views::CustomButton::BS_DISABLED, | 550 forward_->SetImage(views::CustomButton::BS_DISABLED, |
556 tp->GetBitmapNamed(IDR_FORWARD_D)); | 551 tp->GetBitmapNamed(IDR_FORWARD_D)); |
557 forward_->SetBackground(color, background, | |
558 tp->GetBitmapNamed(IDR_FORWARD_MASK)); | |
559 | 552 |
560 home_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_HOME)); | 553 home_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_HOME)); |
561 home_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_HOME_H)); | 554 home_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_HOME_H)); |
562 home_->SetImage(views::CustomButton::BS_PUSHED, | 555 home_->SetImage(views::CustomButton::BS_PUSHED, |
563 tp->GetBitmapNamed(IDR_HOME_P)); | 556 tp->GetBitmapNamed(IDR_HOME_P)); |
564 home_->SetBackground(color, background, | |
565 tp->GetBitmapNamed(IDR_BUTTON_MASK)); | |
566 | 557 |
567 reload_->SetImage(views::CustomButton::BS_NORMAL, | 558 reload_->SetImage(views::CustomButton::BS_NORMAL, |
568 tp->GetBitmapNamed(IDR_RELOAD)); | 559 tp->GetBitmapNamed(IDR_RELOAD)); |
569 reload_->SetImage(views::CustomButton::BS_HOT, | 560 reload_->SetImage(views::CustomButton::BS_HOT, |
570 tp->GetBitmapNamed(IDR_RELOAD_H)); | 561 tp->GetBitmapNamed(IDR_RELOAD_H)); |
571 reload_->SetImage(views::CustomButton::BS_PUSHED, | 562 reload_->SetImage(views::CustomButton::BS_PUSHED, |
572 tp->GetBitmapNamed(IDR_RELOAD_P)); | 563 tp->GetBitmapNamed(IDR_RELOAD_P)); |
573 reload_->SetToggledImage(views::CustomButton::BS_NORMAL, | 564 reload_->SetToggledImage(views::CustomButton::BS_NORMAL, |
574 tp->GetBitmapNamed(IDR_STOP)); | 565 tp->GetBitmapNamed(IDR_STOP)); |
575 reload_->SetToggledImage(views::CustomButton::BS_HOT, | 566 reload_->SetToggledImage(views::CustomButton::BS_HOT, |
576 tp->GetBitmapNamed(IDR_STOP_H)); | 567 tp->GetBitmapNamed(IDR_STOP_H)); |
577 reload_->SetToggledImage(views::CustomButton::BS_PUSHED, | 568 reload_->SetToggledImage(views::CustomButton::BS_PUSHED, |
578 tp->GetBitmapNamed(IDR_STOP_P)); | 569 tp->GetBitmapNamed(IDR_STOP_P)); |
579 reload_->SetBackground(color, background, | |
580 tp->GetBitmapNamed(IDR_BUTTON_MASK)); | |
581 | 570 |
582 app_menu_->SetIcon(GetAppMenuIcon()); | 571 app_menu_->SetIcon(GetAppMenuIcon()); |
583 } | 572 } |
584 | 573 |
585 void ToolbarView::ShowUpgradeReminder() { | 574 void ToolbarView::ShowUpgradeReminder() { |
586 update_reminder_animation_.reset(new SlideAnimation(this)); | 575 update_reminder_animation_.reset(new SlideAnimation(this)); |
587 update_reminder_animation_->SetSlideDuration(kPulseDuration); | 576 update_reminder_animation_->SetSlideDuration(kPulseDuration); |
588 | 577 |
589 // Then start the recurring timer for pulsating it. | 578 // Then start the recurring timer for pulsating it. |
590 upgrade_reminder_pulse_timer_.Start( | 579 upgrade_reminder_pulse_timer_.Start( |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 *tp->GetBitmapNamed(IDR_UPGRADE_DOT_INACTIVE), | 624 *tp->GetBitmapNamed(IDR_UPGRADE_DOT_INACTIVE), |
636 *tp->GetBitmapNamed(IDR_UPGRADE_DOT_ACTIVE), | 625 *tp->GetBitmapNamed(IDR_UPGRADE_DOT_ACTIVE), |
637 value); | 626 value); |
638 } | 627 } |
639 | 628 |
640 canvas->DrawBitmapInt(badge, kUpgradeDotOffset, | 629 canvas->DrawBitmapInt(badge, kUpgradeDotOffset, |
641 icon.height() - badge.height()); | 630 icon.height() - badge.height()); |
642 | 631 |
643 return canvas->ExtractBitmap(); | 632 return canvas->ExtractBitmap(); |
644 } | 633 } |
OLD | NEW |