Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / download / background_theme.mm
blobdec064ca47ede9c0e090a41b341147e7c8710d10
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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/cocoa/download/background_theme.h"
7 #import "chrome/browser/themes/theme_properties.h"
9 BackgroundTheme::BackgroundTheme(ui::ThemeProvider* provider) :
10     provider_(provider) {
11   NSColor* bgColor = [NSColor colorWithCalibratedRed:241/255.0
12                                                green:245/255.0
13                                                 blue:250/255.0
14                                                alpha:77/255.0];
15   NSColor* clickedColor = [NSColor colorWithCalibratedRed:239/255.0
16                                                     green:245/255.0
17                                                      blue:252/255.0
18                                                     alpha:51/255.0];
20   borderColor_.reset(
21       [[NSColor colorWithCalibratedWhite:0 alpha:36/255.0] retain]);
22   buttonGradient_.reset([[NSGradient alloc]
23       initWithColors:[NSArray arrayWithObject:bgColor]]);
24   buttonPressedGradient_.reset([[NSGradient alloc]
25       initWithColors:[NSArray arrayWithObject:clickedColor]]);
28 BackgroundTheme::~BackgroundTheme() {}
30 gfx::ImageSkia* BackgroundTheme::GetImageSkiaNamed(int id) const {
31   return NULL;
34 SkColor BackgroundTheme::GetColor(int id) const {
35   return SkColor();
38 int BackgroundTheme::GetDisplayProperty(int id) const {
39   return -1;
42 bool BackgroundTheme::ShouldUseNativeFrame() const {
43   return false;
46 bool BackgroundTheme::HasCustomImage(int id) const {
47   return false;
50 base::RefCountedMemory* BackgroundTheme::GetRawData(
51     int id,
52     ui::ScaleFactor scale_factor) const {
53   return NULL;
56 NSImage* BackgroundTheme::GetNSImageNamed(int id) const {
57   return nil;
60 NSColor* BackgroundTheme::GetNSImageColorNamed(int id) const {
61   return nil;
64 NSColor* BackgroundTheme::GetNSColor(int id) const {
65   return provider_->GetNSColor(id);
68 NSColor* BackgroundTheme::GetNSColorTint(int id) const {
69   if (id == ThemeProperties::TINT_BUTTONS)
70     return borderColor_.get();
72   return provider_->GetNSColorTint(id);
75 NSGradient* BackgroundTheme::GetNSGradient(int id) const {
76   switch (id) {
77     case ThemeProperties::GRADIENT_TOOLBAR_BUTTON:
78     case ThemeProperties::GRADIENT_TOOLBAR_BUTTON_INACTIVE:
79       return buttonGradient_.get();
80     case ThemeProperties::GRADIENT_TOOLBAR_BUTTON_PRESSED:
81     case ThemeProperties::GRADIENT_TOOLBAR_BUTTON_PRESSED_INACTIVE:
82       return buttonPressedGradient_.get();
83     default:
84       return provider_->GetNSGradient(id);
85   }