| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 #include "base/command_line.h" | 54 #include "base/command_line.h" |
| 55 #include "ui/aura/window.h" | 55 #include "ui/aura/window.h" |
| 56 #endif | 56 #endif |
| 57 | 57 |
| 58 using base::TimeDelta; | 58 using base::TimeDelta; |
| 59 | 59 |
| 60 namespace views { | 60 namespace views { |
| 61 class ClientView; | 61 class ClientView; |
| 62 } | 62 } |
| 63 | 63 |
| 64 // An enumeration of bitmap resources used by this window. | 64 // An enumeration of image resources used by this window. |
| 65 enum { | 65 enum { |
| 66 FRAME_PART_IMAGE_FIRST = 0, // Must be first. | 66 FRAME_PART_IMAGE_FIRST = 0, // Must be first. |
| 67 | 67 |
| 68 // Window Frame Border. | 68 // Window Frame Border. |
| 69 FRAME_BOTTOM_EDGE, | 69 FRAME_BOTTOM_EDGE, |
| 70 FRAME_BOTTOM_LEFT_CORNER, | 70 FRAME_BOTTOM_LEFT_CORNER, |
| 71 FRAME_BOTTOM_RIGHT_CORNER, | 71 FRAME_BOTTOM_RIGHT_CORNER, |
| 72 FRAME_LEFT_EDGE, | 72 FRAME_LEFT_EDGE, |
| 73 FRAME_RIGHT_EDGE, | 73 FRAME_RIGHT_EDGE, |
| 74 FRAME_TOP_EDGE, | 74 FRAME_TOP_EDGE, |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 ConstrainedWindowFrameView::ConstrainedWindowFrameView( | 284 ConstrainedWindowFrameView::ConstrainedWindowFrameView( |
| 285 ConstrainedWindowViews* container) | 285 ConstrainedWindowViews* container) |
| 286 : NonClientFrameView(), | 286 : NonClientFrameView(), |
| 287 container_(container), | 287 container_(container), |
| 288 close_button_(new views::ImageButton(this)), | 288 close_button_(new views::ImageButton(this)), |
| 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 images. |
| 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.GetImageSkiaNamed(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.GetImageSkiaNamed(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.GetImageSkiaNamed(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, |
| (...skipping 347 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 |