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/constrained_window_views.h" | 5 #include "chrome/browser/ui/views/constrained_window_views.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 frame_background_(new views::FrameBackground()) { | 289 frame_background_(new views::FrameBackground()) { |
290 InitClass(); | 290 InitClass(); |
291 InitWindowResources(); | 291 InitWindowResources(); |
292 | 292 |
293 // Constrained windows always use the custom frame - they just have a | 293 // Constrained windows always use the custom frame - they just have a |
294 // different set of bitmaps. | 294 // different set of bitmaps. |
295 container->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); | 295 container->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); |
296 | 296 |
297 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 297 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
298 close_button_->SetImage(views::CustomButton::BS_NORMAL, | 298 close_button_->SetImage(views::CustomButton::BS_NORMAL, |
299 rb.GetBitmapNamed(IDR_CLOSE_SA)); | 299 rb.GetImageSkiaNamed(IDR_CLOSE_SA)); |
300 close_button_->SetImage(views::CustomButton::BS_HOT, | 300 close_button_->SetImage(views::CustomButton::BS_HOT, |
301 rb.GetBitmapNamed(IDR_CLOSE_SA_H)); | 301 rb.GetImageSkiaNamed(IDR_CLOSE_SA_H)); |
302 close_button_->SetImage(views::CustomButton::BS_PUSHED, | 302 close_button_->SetImage(views::CustomButton::BS_PUSHED, |
303 rb.GetBitmapNamed(IDR_CLOSE_SA_P)); | 303 rb.GetImageSkiaNamed(IDR_CLOSE_SA_P)); |
304 close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, | 304 close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, |
305 views::ImageButton::ALIGN_MIDDLE); | 305 views::ImageButton::ALIGN_MIDDLE); |
306 AddChildView(close_button_); | 306 AddChildView(close_button_); |
307 } | 307 } |
308 | 308 |
309 ConstrainedWindowFrameView::~ConstrainedWindowFrameView() { | 309 ConstrainedWindowFrameView::~ConstrainedWindowFrameView() { |
310 } | 310 } |
311 | 311 |
312 void ConstrainedWindowFrameView::UpdateWindowTitle() { | 312 void ConstrainedWindowFrameView::UpdateWindowTitle() { |
313 SchedulePaintInRect(title_bounds_); | 313 SchedulePaintInRect(title_bounds_); |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 } | 652 } |
653 | 653 |
654 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { | 654 void ConstrainedWindowViews::OnNativeConstrainedWindowMouseActivate() { |
655 Activate(); | 655 Activate(); |
656 } | 656 } |
657 | 657 |
658 views::internal::NativeWidgetDelegate* | 658 views::internal::NativeWidgetDelegate* |
659 ConstrainedWindowViews::AsNativeWidgetDelegate() { | 659 ConstrainedWindowViews::AsNativeWidgetDelegate() { |
660 return this; | 660 return this; |
661 } | 661 } |
OLD | NEW |