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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 void AppPanelBrowserFrameView::Layout() { | 228 void AppPanelBrowserFrameView::Layout() { |
229 LayoutWindowControls(); | 229 LayoutWindowControls(); |
230 LayoutTitleBar(); | 230 LayoutTitleBar(); |
231 client_view_bounds_ = CalculateClientAreaBounds(width(), height()); | 231 client_view_bounds_ = CalculateClientAreaBounds(width(), height()); |
232 } | 232 } |
233 | 233 |
234 /////////////////////////////////////////////////////////////////////////////// | 234 /////////////////////////////////////////////////////////////////////////////// |
235 // AppPanelBrowserFrameView, views::ButtonListener implementation: | 235 // AppPanelBrowserFrameView, views::ButtonListener implementation: |
236 | 236 |
237 void AppPanelBrowserFrameView::ButtonPressed(views::Button* sender, | 237 void AppPanelBrowserFrameView::ButtonPressed(views::Button* sender, |
238 const views::Event& event) { | 238 const ui::Event& event) { |
239 if (sender == close_button_) | 239 if (sender == close_button_) |
240 frame()->Close(); | 240 frame()->Close(); |
241 } | 241 } |
242 | 242 |
243 /////////////////////////////////////////////////////////////////////////////// | 243 /////////////////////////////////////////////////////////////////////////////// |
244 // AppPanelBrowserFrameView, TabIconView::TabContentsProvider implementation: | 244 // AppPanelBrowserFrameView, TabIconView::TabContentsProvider implementation: |
245 | 245 |
246 bool AppPanelBrowserFrameView::ShouldTabIconViewAnimate() const { | 246 bool AppPanelBrowserFrameView::ShouldTabIconViewAnimate() const { |
247 // This function is queried during the creation of the window as the | 247 // This function is queried during the creation of the window as the |
248 // TabIconView we host is initialized, so we need to NULL check the selected | 248 // TabIconView we host is initialized, so we need to NULL check the selected |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 } | 508 } |
509 | 509 |
510 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, | 510 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, |
511 int height) const { | 511 int height) const { |
512 int top_height = NonClientTopBorderHeight(); | 512 int top_height = NonClientTopBorderHeight(); |
513 int border_thickness = NonClientBorderThickness(); | 513 int border_thickness = NonClientBorderThickness(); |
514 return gfx::Rect(border_thickness, top_height, | 514 return gfx::Rect(border_thickness, top_height, |
515 std::max(0, width - (2 * border_thickness)), | 515 std::max(0, width - (2 * border_thickness)), |
516 std::max(0, height - top_height - border_thickness)); | 516 std::max(0, height - top_height - border_thickness)); |
517 } | 517 } |
OLD | NEW |