| 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/opaque_browser_frame_view.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 frame()->Close(); | 405 frame()->Close(); |
| 406 } | 406 } |
| 407 | 407 |
| 408 /////////////////////////////////////////////////////////////////////////////// | 408 /////////////////////////////////////////////////////////////////////////////// |
| 409 // OpaqueBrowserFrameView, TabIconView::TabContentsProvider implementation: | 409 // OpaqueBrowserFrameView, TabIconView::TabContentsProvider implementation: |
| 410 | 410 |
| 411 bool OpaqueBrowserFrameView::ShouldTabIconViewAnimate() const { | 411 bool OpaqueBrowserFrameView::ShouldTabIconViewAnimate() const { |
| 412 // This function is queried during the creation of the window as the | 412 // This function is queried during the creation of the window as the |
| 413 // TabIconView we host is initialized, so we need to NULL check the selected | 413 // TabIconView we host is initialized, so we need to NULL check the selected |
| 414 // WebContents because in this condition there is not yet a selected tab. | 414 // WebContents because in this condition there is not yet a selected tab. |
| 415 WebContents* current_tab = browser_view()->GetSelectedWebContents(); | 415 WebContents* current_tab = browser_view()->GetActiveWebContents(); |
| 416 return current_tab ? current_tab->IsLoading() : false; | 416 return current_tab ? current_tab->IsLoading() : false; |
| 417 } | 417 } |
| 418 | 418 |
| 419 gfx::ImageSkia OpaqueBrowserFrameView::GetFaviconForTabIconView() { | 419 gfx::ImageSkia OpaqueBrowserFrameView::GetFaviconForTabIconView() { |
| 420 views::WidgetDelegate* delegate = frame()->widget_delegate(); | 420 views::WidgetDelegate* delegate = frame()->widget_delegate(); |
| 421 if (!delegate) { | 421 if (!delegate) { |
| 422 LOG(WARNING) << "delegate is NULL, returning safe default."; | 422 LOG(WARNING) << "delegate is NULL, returning safe default."; |
| 423 return gfx::ImageSkia(); | 423 return gfx::ImageSkia(); |
| 424 } | 424 } |
| 425 return delegate->GetWindowIcon(); | 425 return delegate->GetWindowIcon(); |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 | 961 |
| 962 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, | 962 gfx::Rect OpaqueBrowserFrameView::CalculateClientAreaBounds(int width, |
| 963 int height) const { | 963 int height) const { |
| 964 int top_height = NonClientTopBorderHeight(false); | 964 int top_height = NonClientTopBorderHeight(false); |
| 965 int border_thickness = NonClientBorderThickness(); | 965 int border_thickness = NonClientBorderThickness(); |
| 966 return gfx::Rect(border_thickness, top_height, | 966 return gfx::Rect(border_thickness, top_height, |
| 967 std::max(0, width - (2 * border_thickness)), | 967 std::max(0, width - (2 * border_thickness)), |
| 968 std::max(0, height - GetReservedHeight() - | 968 std::max(0, height - GetReservedHeight() - |
| 969 top_height - border_thickness)); | 969 top_height - border_thickness)); |
| 970 } | 970 } |
| OLD | NEW |