| 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/ash/browser_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.h" |
| 6 | 6 |
| 7 #include "ash/wm/frame_painter.h" | 7 #include "ash/wm/frame_painter.h" |
| 8 #include "ash/wm/workspace/frame_maximize_button.h" | 8 #include "ash/wm/workspace/frame_maximize_button.h" |
| 9 #include "chrome/browser/themes/theme_service.h" | 9 #include "chrome/browser/themes/theme_service.h" |
| 10 #include "chrome/browser/ui/views/avatar_menu_button.h" | 10 #include "chrome/browser/ui/views/avatar_menu_button.h" |
| 11 #include "chrome/browser/ui/views/frame/browser_frame.h" | 11 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 12 #include "chrome/browser/ui/views/frame/browser_view.h" | 12 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 13 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 13 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 #include "grit/generated_resources.h" // Accessibility names | 15 #include "grit/generated_resources.h" // Accessibility names |
| 16 #include "grit/theme_resources.h" | 16 #include "grit/theme_resources.h" |
| 17 #include "grit/theme_resources_standard.h" | 17 #include "grit/theme_resources_standard.h" |
| 18 #include "grit/ui_resources.h" | 18 #include "grit/ui_resources.h" |
| 19 #include "ui/aura/client/aura_constants.h" |
| 19 #include "ui/aura/window.h" | 20 #include "ui/aura/window.h" |
| 20 #include "ui/aura/client/aura_constants.h" | |
| 21 #include "ui/base/accessibility/accessible_view_state.h" | 21 #include "ui/base/accessibility/accessible_view_state.h" |
| 22 #include "ui/base/hit_test.h" | 22 #include "ui/base/hit_test.h" |
| 23 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| 24 #include "ui/base/layout.h" | 24 #include "ui/base/layout.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "ui/base/theme_provider.h" | 26 #include "ui/base/theme_provider.h" |
| 27 #include "ui/gfx/canvas.h" | 27 #include "ui/gfx/canvas.h" |
| 28 #include "ui/views/controls/button/image_button.h" | 28 #include "ui/views/controls/button/image_button.h" |
| 29 #include "ui/views/widget/widget.h" | 29 #include "ui/views/widget/widget.h" |
| 30 #include "ui/views/widget/widget_delegate.h" | 30 #include "ui/views/widget/widget_delegate.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 // TabIconView::TabIconViewModel overrides: | 334 // TabIconView::TabIconViewModel overrides: |
| 335 | 335 |
| 336 bool BrowserNonClientFrameViewAsh::ShouldTabIconViewAnimate() const { | 336 bool BrowserNonClientFrameViewAsh::ShouldTabIconViewAnimate() const { |
| 337 // This function is queried during the creation of the window as the | 337 // This function is queried during the creation of the window as the |
| 338 // TabIconView we host is initialized, so we need to NULL check the selected | 338 // TabIconView we host is initialized, so we need to NULL check the selected |
| 339 // WebContents because in this condition there is not yet a selected tab. | 339 // WebContents because in this condition there is not yet a selected tab. |
| 340 content::WebContents* current_tab = browser_view()->GetSelectedWebContents(); | 340 content::WebContents* current_tab = browser_view()->GetSelectedWebContents(); |
| 341 return current_tab ? current_tab->IsLoading() : false; | 341 return current_tab ? current_tab->IsLoading() : false; |
| 342 } | 342 } |
| 343 | 343 |
| 344 SkBitmap BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() { | 344 gfx::ImageSkia BrowserNonClientFrameViewAsh::GetFaviconForTabIconView() { |
| 345 views::WidgetDelegate* delegate = frame()->widget_delegate(); | 345 views::WidgetDelegate* delegate = frame()->widget_delegate(); |
| 346 if (!delegate) | 346 if (!delegate) |
| 347 return SkBitmap(); | 347 return SkBitmap(); |
| 348 return delegate->GetWindowIcon(); | 348 return delegate->GetWindowIcon(); |
| 349 } | 349 } |
| 350 | 350 |
| 351 /////////////////////////////////////////////////////////////////////////////// | 351 /////////////////////////////////////////////////////////////////////////////// |
| 352 // BrowserNonClientFrameViewAsh, private: | 352 // BrowserNonClientFrameViewAsh, private: |
| 353 | 353 |
| 354 | 354 |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 BrowserNonClientFrameViewAsh::GetThemeFrameOverlayBitmap() const { | 512 BrowserNonClientFrameViewAsh::GetThemeFrameOverlayBitmap() const { |
| 513 ui::ThemeProvider* tp = GetThemeProvider(); | 513 ui::ThemeProvider* tp = GetThemeProvider(); |
| 514 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && | 514 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && |
| 515 browser_view()->IsBrowserTypeNormal() && | 515 browser_view()->IsBrowserTypeNormal() && |
| 516 !browser_view()->IsOffTheRecord()) { | 516 !browser_view()->IsOffTheRecord()) { |
| 517 return tp->GetBitmapNamed(ShouldPaintAsActive() ? | 517 return tp->GetBitmapNamed(ShouldPaintAsActive() ? |
| 518 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); | 518 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE); |
| 519 } | 519 } |
| 520 return NULL; | 520 return NULL; |
| 521 } | 521 } |
| OLD | NEW |