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/themes/browser_theme_pack.h" | 5 #include "chrome/browser/themes/browser_theme_pack.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/data_pack.h" | 8 #include "base/data_pack.h" |
9 #include "base/stl_util-inl.h" | 9 #include "base/stl_util-inl.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 pack->GenerateTabBackgroundImages(&pack->prepared_images_); | 361 pack->GenerateTabBackgroundImages(&pack->prepared_images_); |
362 | 362 |
363 // The BrowserThemePack is now in a consistent state. | 363 // The BrowserThemePack is now in a consistent state. |
364 return pack; | 364 return pack; |
365 } | 365 } |
366 | 366 |
367 // static | 367 // static |
368 scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromDataPack( | 368 scoped_refptr<BrowserThemePack> BrowserThemePack::BuildFromDataPack( |
369 FilePath path, const std::string& expected_id) { | 369 FilePath path, const std::string& expected_id) { |
370 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 370 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
371 scoped_refptr<BrowserThemePack> pack = new BrowserThemePack; | 371 scoped_refptr<BrowserThemePack> pack(new BrowserThemePack); |
372 pack->data_pack_.reset(new base::DataPack); | 372 pack->data_pack_.reset(new base::DataPack); |
373 | 373 |
374 if (!pack->data_pack_->Load(path)) { | 374 if (!pack->data_pack_->Load(path)) { |
375 LOG(ERROR) << "Failed to load theme data pack."; | 375 LOG(ERROR) << "Failed to load theme data pack."; |
376 return NULL; | 376 return NULL; |
377 } | 377 } |
378 | 378 |
379 base::StringPiece pointer; | 379 base::StringPiece pointer; |
380 if (!pack->data_pack_->GetStringPiece(kHeaderID, &pointer)) | 380 if (!pack->data_pack_->GetStringPiece(kHeaderID, &pointer)) |
381 return NULL; | 381 return NULL; |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 hsl.h = tints_[i].h; | 1036 hsl.h = tints_[i].h; |
1037 hsl.s = tints_[i].s; | 1037 hsl.s = tints_[i].s; |
1038 hsl.l = tints_[i].l; | 1038 hsl.l = tints_[i].l; |
1039 return hsl; | 1039 return hsl; |
1040 } | 1040 } |
1041 } | 1041 } |
1042 } | 1042 } |
1043 | 1043 |
1044 return BrowserThemeProvider::GetDefaultTint(id); | 1044 return BrowserThemeProvider::GetDefaultTint(id); |
1045 } | 1045 } |
OLD | NEW |