| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chromeos/frame/panel_controller.h" | 5 #include "chrome/browser/chromeos/frame/panel_controller.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "base/singleton.h" | 12 #include "base/singleton.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "chrome/browser/chromeos/wm_ipc.h" | 15 #include "chrome/browser/chromeos/wm_ipc.h" |
| 16 #include "chrome/browser/ui/browser.h" | |
| 17 #include "chrome/common/notification_service.h" | 16 #include "chrome/common/notification_service.h" |
| 18 #include "gfx/canvas_skia.h" | 17 #include "gfx/canvas_skia.h" |
| 19 #include "grit/app_resources.h" | 18 #include "grit/app_resources.h" |
| 20 #include "grit/generated_resources.h" | 19 #include "grit/generated_resources.h" |
| 21 #include "grit/theme_resources.h" | 20 #include "grit/theme_resources.h" |
| 22 #include "third_party/cros/chromeos_wm_ipc_enums.h" | 21 #include "third_party/cros/chromeos_wm_ipc_enums.h" |
| 23 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" | 22 #include "third_party/skia/include/effects/SkBlurMaskFilter.h" |
| 24 #include "third_party/skia/include/effects/SkGradientShader.h" | 23 #include "third_party/skia/include/effects/SkGradientShader.h" |
| 25 #include "views/controls/button/image_button.h" | 24 #include "views/controls/button/image_button.h" |
| 26 #include "views/controls/image_view.h" | 25 #include "views/controls/image_view.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 SkScalar corners[] = { | 63 SkScalar corners[] = { |
| 65 kTitleCornerRadius, kTitleCornerRadius, | 64 kTitleCornerRadius, kTitleCornerRadius, |
| 66 kTitleCornerRadius, kTitleCornerRadius, | 65 kTitleCornerRadius, kTitleCornerRadius, |
| 67 0, 0, | 66 0, 0, |
| 68 0, 0 | 67 0, 0 |
| 69 }; | 68 }; |
| 70 path.addRoundRect(rect, corners); | 69 path.addRoundRect(rect, corners); |
| 71 SkPaint paint; | 70 SkPaint paint; |
| 72 paint.setStyle(SkPaint::kFill_Style); | 71 paint.setStyle(SkPaint::kFill_Style); |
| 73 paint.setFlags(SkPaint::kAntiAlias_Flag); | 72 paint.setFlags(SkPaint::kAntiAlias_Flag); |
| 74 SkPoint p[2] = {{0, 0}, {0, h}}; | 73 SkPoint p[2] = { {0, 0}, {0, h} }; |
| 75 SkColor colors[2] = {kTitleActiveGradientStart, kTitleActiveGradientEnd}; | 74 SkColor colors[2] = {kTitleActiveGradientStart, kTitleActiveGradientEnd}; |
| 76 SkShader* s = SkGradientShader::CreateLinear( | 75 SkShader* s = SkGradientShader::CreateLinear( |
| 77 p, colors, NULL, 2, SkShader::kClamp_TileMode, NULL); | 76 p, colors, NULL, 2, SkShader::kClamp_TileMode, NULL); |
| 78 paint.setShader(s); | 77 paint.setShader(s); |
| 79 // Need to unref shader, otherwise never deleted. | 78 // Need to unref shader, otherwise never deleted. |
| 80 s->unref(); | 79 s->unref(); |
| 81 canvas->AsCanvasSkia()->drawPath(path, paint); | 80 canvas->AsCanvasSkia()->drawPath(path, paint); |
| 82 } | 81 } |
| 83 }; | 82 }; |
| 84 | 83 |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 views::Button* sender, const views::Event& event) { | 397 views::Button* sender, const views::Event& event) { |
| 399 if (panel_controller_ && sender == close_button_) | 398 if (panel_controller_ && sender == close_button_) |
| 400 panel_controller_->OnCloseButtonPressed(); | 399 panel_controller_->OnCloseButtonPressed(); |
| 401 } | 400 } |
| 402 | 401 |
| 403 PanelController::TitleContentView::~TitleContentView() { | 402 PanelController::TitleContentView::~TitleContentView() { |
| 404 VLOG(1) << "panel: delete " << this; | 403 VLOG(1) << "panel: delete " << this; |
| 405 } | 404 } |
| 406 | 405 |
| 407 } // namespace chromeos | 406 } // namespace chromeos |
| OLD | NEW |