| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 frame()->Close(); | 236 frame()->Close(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 /////////////////////////////////////////////////////////////////////////////// | 239 /////////////////////////////////////////////////////////////////////////////// |
| 240 // AppPanelBrowserFrameView, TabIconView::TabContentsProvider implementation: | 240 // AppPanelBrowserFrameView, TabIconView::TabContentsProvider implementation: |
| 241 | 241 |
| 242 bool AppPanelBrowserFrameView::ShouldTabIconViewAnimate() const { | 242 bool AppPanelBrowserFrameView::ShouldTabIconViewAnimate() const { |
| 243 // This function is queried during the creation of the window as the | 243 // This function is queried during the creation of the window as the |
| 244 // TabIconView we host is initialized, so we need to NULL check the selected | 244 // TabIconView we host is initialized, so we need to NULL check the selected |
| 245 // WebContents because in this condition there is not yet a selected tab. | 245 // WebContents because in this condition there is not yet a selected tab. |
| 246 WebContents* current_tab = browser_view()->GetSelectedWebContents(); | 246 WebContents* current_tab = browser_view()->GetActiveWebContents(); |
| 247 return current_tab ? current_tab->IsLoading() : false; | 247 return current_tab ? current_tab->IsLoading() : false; |
| 248 } | 248 } |
| 249 | 249 |
| 250 gfx::ImageSkia AppPanelBrowserFrameView::GetFaviconForTabIconView() { | 250 gfx::ImageSkia AppPanelBrowserFrameView::GetFaviconForTabIconView() { |
| 251 return frame()->widget_delegate()->GetWindowIcon(); | 251 return frame()->widget_delegate()->GetWindowIcon(); |
| 252 } | 252 } |
| 253 | 253 |
| 254 /////////////////////////////////////////////////////////////////////////////// | 254 /////////////////////////////////////////////////////////////////////////////// |
| 255 // AppPanelBrowserFrameView, private: | 255 // AppPanelBrowserFrameView, private: |
| 256 | 256 |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 } | 504 } |
| 505 | 505 |
| 506 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, | 506 gfx::Rect AppPanelBrowserFrameView::CalculateClientAreaBounds(int width, |
| 507 int height) const { | 507 int height) const { |
| 508 int top_height = NonClientTopBorderHeight(); | 508 int top_height = NonClientTopBorderHeight(); |
| 509 int border_thickness = NonClientBorderThickness(); | 509 int border_thickness = NonClientBorderThickness(); |
| 510 return gfx::Rect(border_thickness, top_height, | 510 return gfx::Rect(border_thickness, top_height, |
| 511 std::max(0, width - (2 * border_thickness)), | 511 std::max(0, width - (2 * border_thickness)), |
| 512 std::max(0, height - top_height - border_thickness)); | 512 std::max(0, height - top_height - border_thickness)); |
| 513 } | 513 } |
| OLD | NEW |