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