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_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/frame/app_non_client_frame_view_ash.h" |
6 | 6 |
7 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" | 7 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 control_view_ = new ash::FrameCaptionButtonContainerView(frame, | 122 control_view_ = new ash::FrameCaptionButtonContainerView(frame, |
123 ash::FrameCaptionButtonContainerView::MINIMIZE_ALLOWED); | 123 ash::FrameCaptionButtonContainerView::MINIMIZE_ALLOWED); |
124 control_view_->set_header_style( | 124 control_view_->set_header_style( |
125 ash::FrameCaptionButtonContainerView::HEADER_STYLE_MAXIMIZED_HOSTED_APP); | 125 ash::FrameCaptionButtonContainerView::HEADER_STYLE_MAXIMIZED_HOSTED_APP); |
126 control_view_->set_border(new ControlViewBorder()); | 126 control_view_->set_border(new ControlViewBorder()); |
127 control_view_->set_background(new ControlViewBackground( | 127 control_view_->set_background(new ControlViewBackground( |
128 browser_view->IsOffTheRecord())); | 128 browser_view->IsOffTheRecord())); |
129 | 129 |
130 // This FrameView is always maximized so we don't want the window to have | 130 // This FrameView is always maximized so we don't want the window to have |
131 // resize borders. | 131 // resize borders. |
132 frame->GetNativeView()->set_hit_test_bounds_override_inner(gfx::Insets()); | 132 frame->GetNativeView()->SetHitTestBoundsOverrideInner( |
| 133 gfx::Insets(), gfx::Insets()); |
133 // Watch for frame close so we can clean up the control widget. | 134 // Watch for frame close so we can clean up the control widget. |
134 frame->AddObserver(frame_observer_.get()); | 135 frame->AddObserver(frame_observer_.get()); |
135 set_background(views::Background::CreateSolidBackground(SK_ColorBLACK)); | 136 set_background(views::Background::CreateSolidBackground(SK_ColorBLACK)); |
136 // Create the controls. | 137 // Create the controls. |
137 control_widget_ = new views::Widget; | 138 control_widget_ = new views::Widget; |
138 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); | 139 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
139 params.parent = browser_view->GetNativeWindow(); | 140 params.parent = browser_view->GetNativeWindow(); |
140 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 141 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
141 control_widget_->Init(params); | 142 control_widget_->Init(params); |
142 control_widget_->SetContentsView(control_view_); | 143 control_widget_->SetContentsView(control_view_); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 base::i18n::IsRTL() ? 0 : (width() - preferred.width()), 0, | 228 base::i18n::IsRTL() ? 0 : (width() - preferred.width()), 0, |
228 preferred.width(), preferred.height()); | 229 preferred.width(), preferred.height()); |
229 } | 230 } |
230 | 231 |
231 void AppNonClientFrameViewAsh::CloseControlWidget() { | 232 void AppNonClientFrameViewAsh::CloseControlWidget() { |
232 if (control_widget_) { | 233 if (control_widget_) { |
233 control_widget_->Close(); | 234 control_widget_->Close(); |
234 control_widget_ = NULL; | 235 control_widget_ = NULL; |
235 } | 236 } |
236 } | 237 } |
OLD | NEW |