| 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/themes/browser_theme_pack.h" | 5 #include "chrome/browser/themes/browser_theme_pack.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted_memory.h" | 9 #include "base/memory/ref_counted_memory.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 378 |
| 379 // static | 379 // static |
| 380 scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromDataPack( | 380 scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromDataPack( |
| 381 FilePath path, const std::string& expected_id) { | 381 FilePath path, const std::string& expected_id) { |
| 382 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 382 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 383 // Allow IO on UI thread due to deep-seated theme design issues. | 383 // Allow IO on UI thread due to deep-seated theme design issues. |
| 384 // (see http://crbug.com/80206) | 384 // (see http://crbug.com/80206) |
| 385 base::ThreadRestrictions::ScopedAllowIO allow_io; | 385 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 386 scoped_refptr<BrowserThemePack> pack(new BrowserThemePack); | 386 scoped_refptr<BrowserThemePack> pack(new BrowserThemePack); |
| 387 pack->data_pack_.reset( | 387 pack->data_pack_.reset( |
| 388 new ui::DataPack(ui::ResourceHandle::kScaleFactor100x)); | 388 new ui::DataPack(ui::SCALE_FACTOR_100P)); |
| 389 | 389 |
| 390 if (!pack->data_pack_->Load(path)) { | 390 if (!pack->data_pack_->Load(path)) { |
| 391 LOG(ERROR) << "Failed to load theme data pack."; | 391 LOG(ERROR) << "Failed to load theme data pack."; |
| 392 return NULL; | 392 return NULL; |
| 393 } | 393 } |
| 394 | 394 |
| 395 base::StringPiece pointer; | 395 base::StringPiece pointer; |
| 396 if (!pack->data_pack_->GetStringPiece(kHeaderID, &pointer)) | 396 if (!pack->data_pack_->GetStringPiece(kHeaderID, &pointer)) |
| 397 return NULL; | 397 return NULL; |
| 398 pack->header_ = reinterpret_cast<BrowserThemePackHeader*>(const_cast<char*>( | 398 pack->header_ = reinterpret_cast<BrowserThemePackHeader*>(const_cast<char*>( |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 hsl.h = tints_[i].h; | 1075 hsl.h = tints_[i].h; |
| 1076 hsl.s = tints_[i].s; | 1076 hsl.s = tints_[i].s; |
| 1077 hsl.l = tints_[i].l; | 1077 hsl.l = tints_[i].l; |
| 1078 return hsl; | 1078 return hsl; |
| 1079 } | 1079 } |
| 1080 } | 1080 } |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 return ThemeService::GetDefaultTint(id); | 1083 return ThemeService::GetDefaultTint(id); |
| 1084 } | 1084 } |
| OLD | NEW |