| OLD | NEW |
| 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/notifications/balloon_view.h" | 5 #include "chrome/browser/ui/views/notifications/balloon_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 frame_container_->Init(params); | 373 frame_container_->Init(params); |
| 374 frame_container_->SetContentsView(this); | 374 frame_container_->SetContentsView(this); |
| 375 frame_container_->StackAboveWidget(html_container_); | 375 frame_container_->StackAboveWidget(html_container_); |
| 376 | 376 |
| 377 // SetAlwaysOnTop should be called after StackAboveWidget because otherwise | 377 // SetAlwaysOnTop should be called after StackAboveWidget because otherwise |
| 378 // the top-most flag will be removed. | 378 // the top-most flag will be removed. |
| 379 html_container_->SetAlwaysOnTop(true); | 379 html_container_->SetAlwaysOnTop(true); |
| 380 frame_container_->SetAlwaysOnTop(true); | 380 frame_container_->SetAlwaysOnTop(true); |
| 381 | 381 |
| 382 close_button_->SetImage(views::CustomButton::BS_NORMAL, | 382 close_button_->SetImage(views::CustomButton::BS_NORMAL, |
| 383 rb.GetBitmapNamed(IDR_TAB_CLOSE)); | 383 rb.GetImageSkiaNamed(IDR_TAB_CLOSE)); |
| 384 close_button_->SetImage(views::CustomButton::BS_HOT, | 384 close_button_->SetImage(views::CustomButton::BS_HOT, |
| 385 rb.GetBitmapNamed(IDR_TAB_CLOSE_H)); | 385 rb.GetImageSkiaNamed(IDR_TAB_CLOSE_H)); |
| 386 close_button_->SetImage(views::CustomButton::BS_PUSHED, | 386 close_button_->SetImage(views::CustomButton::BS_PUSHED, |
| 387 rb.GetBitmapNamed(IDR_TAB_CLOSE_P)); | 387 rb.GetImageSkiaNamed(IDR_TAB_CLOSE_P)); |
| 388 close_button_->SetBoundsRect(GetCloseButtonBounds()); | 388 close_button_->SetBoundsRect(GetCloseButtonBounds()); |
| 389 close_button_->SetBackground(SK_ColorBLACK, | 389 close_button_->SetBackground(SK_ColorBLACK, |
| 390 rb.GetBitmapNamed(IDR_TAB_CLOSE), | 390 rb.GetImageSkiaNamed(IDR_TAB_CLOSE), |
| 391 rb.GetBitmapNamed(IDR_TAB_CLOSE_MASK)); | 391 rb.GetImageSkiaNamed(IDR_TAB_CLOSE_MASK)); |
| 392 | 392 |
| 393 options_menu_button_->SetIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH)); | 393 options_menu_button_->SetIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH)); |
| 394 options_menu_button_->SetHoverIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH_H)); | 394 options_menu_button_->SetHoverIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH_H)); |
| 395 options_menu_button_->SetPushedIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH_P)); | 395 options_menu_button_->SetPushedIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH_P)); |
| 396 options_menu_button_->set_alignment(views::TextButton::ALIGN_CENTER); | 396 options_menu_button_->set_alignment(views::TextButton::ALIGN_CENTER); |
| 397 options_menu_button_->set_border(NULL); | 397 options_menu_button_->set_border(NULL); |
| 398 options_menu_button_->SetBoundsRect(GetOptionsButtonBounds()); | 398 options_menu_button_->SetBoundsRect(GetOptionsButtonBounds()); |
| 399 | 399 |
| 400 source_label_->SetFont(rb.GetFont(ui::ResourceBundle::SmallFont)); | 400 source_label_->SetFont(rb.GetFont(ui::ResourceBundle::SmallFont)); |
| 401 source_label_->SetBackgroundColor(kControlBarBackgroundColor); | 401 source_label_->SetBackgroundColor(kControlBarBackgroundColor); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 return; | 539 return; |
| 540 } | 540 } |
| 541 | 541 |
| 542 // If the renderer process attached to this balloon is disconnected | 542 // If the renderer process attached to this balloon is disconnected |
| 543 // (e.g., because of a crash), we want to close the balloon. | 543 // (e.g., because of a crash), we want to close the balloon. |
| 544 notification_registrar_.Remove( | 544 notification_registrar_.Remove( |
| 545 this, chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, | 545 this, chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, |
| 546 content::Source<Balloon>(balloon_)); | 546 content::Source<Balloon>(balloon_)); |
| 547 Close(false); | 547 Close(false); |
| 548 } | 548 } |
| OLD | NEW |