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/frame/app_panel_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/app_panel_browser_frame_view.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/ui/views/frame/browser_frame.h" | 9 #include "chrome/browser/ui/views/frame/browser_frame.h" |
10 #include "chrome/browser/ui/views/frame/browser_view.h" | 10 #include "chrome/browser/ui/views/frame/browser_view.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 ALLOW_THIS_IN_INITIALIZER_LIST( | 66 ALLOW_THIS_IN_INITIALIZER_LIST( |
67 close_button_(new views::ImageButton(this))), | 67 close_button_(new views::ImageButton(this))), |
68 window_icon_(NULL) { | 68 window_icon_(NULL) { |
69 DCHECK(browser_view->ShouldShowWindowIcon()); | 69 DCHECK(browser_view->ShouldShowWindowIcon()); |
70 DCHECK(browser_view->ShouldShowWindowTitle()); | 70 DCHECK(browser_view->ShouldShowWindowTitle()); |
71 | 71 |
72 frame->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); | 72 frame->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM); |
73 | 73 |
74 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 74 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
75 close_button_->SetImage(views::CustomButton::BS_NORMAL, | 75 close_button_->SetImage(views::CustomButton::BS_NORMAL, |
76 rb.GetBitmapNamed(IDR_CLOSE_BAR)); | 76 rb.GetImageSkiaNamed(IDR_CLOSE_BAR)); |
77 close_button_->SetImage(views::CustomButton::BS_HOT, | 77 close_button_->SetImage(views::CustomButton::BS_HOT, |
78 rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); | 78 rb.GetImageSkiaNamed(IDR_CLOSE_BAR_H)); |
79 close_button_->SetImage(views::CustomButton::BS_PUSHED, | 79 close_button_->SetImage(views::CustomButton::BS_PUSHED, |
80 rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); | 80 rb.GetImageSkiaNamed(IDR_CLOSE_BAR_P)); |
81 close_button_->SetAccessibleName( | 81 close_button_->SetAccessibleName( |
82 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); | 82 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); |
83 AddChildView(close_button_); | 83 AddChildView(close_button_); |
84 | 84 |
85 window_icon_ = new TabIconView(this); | 85 window_icon_ = new TabIconView(this); |
86 window_icon_->set_is_light(true); | 86 window_icon_->set_is_light(true); |
87 AddChildView(window_icon_); | 87 AddChildView(window_icon_); |
88 window_icon_->Update(); | 88 window_icon_->Update(); |
89 } | 89 } |
90 | 90 |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 } | 503 } |
504 | 504 |
505 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, | 505 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, |
506 int height) const { | 506 int height) const { |
507 int top_height = NonClientTopBorderHeight(); | 507 int top_height = NonClientTopBorderHeight(); |
508 int border_thickness = NonClientBorderThickness(); | 508 int border_thickness = NonClientBorderThickness(); |
509 return gfx::Rect(border_thickness, top_height, | 509 return gfx::Rect(border_thickness, top_height, |
510 std::max(0, width - (2 * border_thickness)), | 510 std::max(0, width - (2 * border_thickness)), |
511 std::max(0, height - top_height - border_thickness)); | 511 std::max(0, height - top_height - border_thickness)); |
512 } | 512 } |
OLD | NEW |