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_aura.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.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 "chrome/browser/themes/theme_service.h" | 9 #include "chrome/browser/themes/theme_service.h" |
9 #include "chrome/browser/ui/views/frame/browser_frame.h" | 10 #include "chrome/browser/ui/views/frame/browser_frame.h" |
10 #include "chrome/browser/ui/views/frame/browser_view.h" | 11 #include "chrome/browser/ui/views/frame/browser_view.h" |
11 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
12 #include "grit/generated_resources.h" // Accessibility names | 13 #include "grit/generated_resources.h" // Accessibility names |
13 #include "grit/theme_resources.h" | 14 #include "grit/theme_resources.h" |
14 #include "grit/theme_resources_standard.h" | 15 #include "grit/theme_resources_standard.h" |
15 #include "grit/ui_resources.h" | 16 #include "grit/ui_resources.h" |
16 #include "ui/base/accessibility/accessible_view_state.h" | 17 #include "ui/base/accessibility/accessible_view_state.h" |
17 #include "ui/base/l10n/l10n_util.h" | 18 #include "ui/base/l10n/l10n_util.h" |
(...skipping 27 matching lines...) Expand all Loading... |
45 close_button_(NULL), | 46 close_button_(NULL), |
46 window_icon_(NULL), | 47 window_icon_(NULL), |
47 frame_painter_(new ash::FramePainter) { | 48 frame_painter_(new ash::FramePainter) { |
48 } | 49 } |
49 | 50 |
50 BrowserNonClientFrameViewAura::~BrowserNonClientFrameViewAura() { | 51 BrowserNonClientFrameViewAura::~BrowserNonClientFrameViewAura() { |
51 } | 52 } |
52 | 53 |
53 void BrowserNonClientFrameViewAura::Init() { | 54 void BrowserNonClientFrameViewAura::Init() { |
54 // Caption buttons. | 55 // Caption buttons. |
55 maximize_button_ = new views::ImageButton(this); | 56 maximize_button_ = new ash::FrameMaximizeButton(this); |
56 maximize_button_->SetAccessibleName( | 57 maximize_button_->SetAccessibleName( |
57 l10n_util::GetStringUTF16(IDS_ACCNAME_MAXIMIZE)); | 58 l10n_util::GetStringUTF16(IDS_ACCNAME_MAXIMIZE)); |
58 AddChildView(maximize_button_); | 59 AddChildView(maximize_button_); |
59 close_button_ = new views::ImageButton(this); | 60 close_button_ = new views::ImageButton(this); |
60 close_button_->SetAccessibleName( | 61 close_button_->SetAccessibleName( |
61 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); | 62 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); |
62 AddChildView(close_button_); | 63 AddChildView(close_button_); |
63 | 64 |
64 // Initializing the TabIconView is expensive, so only do it if we need to. | 65 // Initializing the TabIconView is expensive, so only do it if we need to. |
65 if (browser_view()->ShouldShowWindowIcon()) { | 66 if (browser_view()->ShouldShowWindowIcon()) { |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 } | 345 } |
345 | 346 |
346 SkBitmap* BrowserNonClientFrameViewAura::GetCustomBitmap( | 347 SkBitmap* BrowserNonClientFrameViewAura::GetCustomBitmap( |
347 int bitmap_id, | 348 int bitmap_id, |
348 int fallback_bitmap_id) const { | 349 int fallback_bitmap_id) const { |
349 ui::ThemeProvider* tp = GetThemeProvider(); | 350 ui::ThemeProvider* tp = GetThemeProvider(); |
350 if (tp->HasCustomImage(bitmap_id)) | 351 if (tp->HasCustomImage(bitmap_id)) |
351 return tp->GetBitmapNamed(bitmap_id); | 352 return tp->GetBitmapNamed(bitmap_id); |
352 return tp->GetBitmapNamed(fallback_bitmap_id); | 353 return tp->GetBitmapNamed(fallback_bitmap_id); |
353 } | 354 } |
OLD | NEW |