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/browser_non_client_frame_view_ash.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_ash.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" | 8 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
9 #include "ash/wm/frame_border_hit_test_controller.h" | 9 #include "ash/wm/frame_border_hit_test_controller.h" |
10 #include "ash/wm/header_painter.h" | 10 #include "ash/wm/header_painter.h" |
| 11 #include "ash/wm/window_state.h" |
11 #include "chrome/browser/themes/theme_properties.h" | 12 #include "chrome/browser/themes/theme_properties.h" |
12 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/views/avatar_label.h" | 14 #include "chrome/browser/ui/views/avatar_label.h" |
14 #include "chrome/browser/ui/views/avatar_menu_button.h" | 15 #include "chrome/browser/ui/views/avatar_menu_button.h" |
15 #include "chrome/browser/ui/views/frame/browser_frame.h" | 16 #include "chrome/browser/ui/views/frame/browser_frame.h" |
16 #include "chrome/browser/ui/views/frame/browser_view.h" | 17 #include "chrome/browser/ui/views/frame/browser_view.h" |
17 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 18 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
18 #include "chrome/browser/ui/views/tab_icon_view.h" | 19 #include "chrome/browser/ui/views/tab_icon_view.h" |
19 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 20 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
20 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 void BrowserNonClientFrameViewAsh::UpdateWindowIcon() { | 229 void BrowserNonClientFrameViewAsh::UpdateWindowIcon() { |
229 if (window_icon_) | 230 if (window_icon_) |
230 window_icon_->SchedulePaint(); | 231 window_icon_->SchedulePaint(); |
231 } | 232 } |
232 | 233 |
233 void BrowserNonClientFrameViewAsh::UpdateWindowTitle() { | 234 void BrowserNonClientFrameViewAsh::UpdateWindowTitle() { |
234 if (!frame()->IsFullscreen()) | 235 if (!frame()->IsFullscreen()) |
235 header_painter_->SchedulePaintForTitle(BrowserFrame::GetTitleFont()); | 236 header_painter_->SchedulePaintForTitle(BrowserFrame::GetTitleFont()); |
236 } | 237 } |
237 | 238 |
| 239 bool BrowserNonClientFrameViewAsh::IsDocked() const { |
| 240 return ash::wm::GetWindowState(frame()->GetNativeWindow())->IsDocked(); |
| 241 } |
| 242 |
238 /////////////////////////////////////////////////////////////////////////////// | 243 /////////////////////////////////////////////////////////////////////////////// |
239 // views::View overrides: | 244 // views::View overrides: |
240 | 245 |
241 void BrowserNonClientFrameViewAsh::OnPaint(gfx::Canvas* canvas) { | 246 void BrowserNonClientFrameViewAsh::OnPaint(gfx::Canvas* canvas) { |
242 if (!ShouldPaint()) | 247 if (!ShouldPaint()) |
243 return; | 248 return; |
244 | 249 |
245 if (UseImmersiveLightbarHeaderStyle()) { | 250 if (UseImmersiveLightbarHeaderStyle()) { |
246 PaintImmersiveLightbarStyleHeader(canvas); | 251 PaintImmersiveLightbarStyleHeader(canvas); |
247 return; | 252 return; |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 int BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImageId() const { | 574 int BrowserNonClientFrameViewAsh::GetThemeFrameOverlayImageId() const { |
570 ui::ThemeProvider* tp = GetThemeProvider(); | 575 ui::ThemeProvider* tp = GetThemeProvider(); |
571 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && | 576 if (tp->HasCustomImage(IDR_THEME_FRAME_OVERLAY) && |
572 browser_view()->IsBrowserTypeNormal() && | 577 browser_view()->IsBrowserTypeNormal() && |
573 !browser_view()->IsOffTheRecord()) { | 578 !browser_view()->IsOffTheRecord()) { |
574 return ShouldPaintAsActive() ? | 579 return ShouldPaintAsActive() ? |
575 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE; | 580 IDR_THEME_FRAME_OVERLAY : IDR_THEME_FRAME_OVERLAY_INACTIVE; |
576 } | 581 } |
577 return 0; | 582 return 0; |
578 } | 583 } |
OLD | NEW |