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 "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/json/json_file_value_serializer.h" | 8 #include "base/json/json_file_value_serializer.h" |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void ParseImageNamesDictionary(DictionaryValue* value, | 119 void ParseImageNamesDictionary(DictionaryValue* value, |
120 std::map<int, FilePath>* out_file_paths) { | 120 std::map<int, FilePath>* out_file_paths) { |
121 theme_pack_->ParseImageNamesFromJSON(value, FilePath(), out_file_paths); | 121 theme_pack_->ParseImageNamesFromJSON(value, FilePath(), out_file_paths); |
122 | 122 |
123 // Build the source image list for HasCustomImage(). | 123 // Build the source image list for HasCustomImage(). |
124 theme_pack_->BuildSourceImagesArray(*out_file_paths); | 124 theme_pack_->BuildSourceImagesArray(*out_file_paths); |
125 } | 125 } |
126 | 126 |
127 bool LoadRawBitmapsTo(const std::map<int, FilePath>& out_file_paths) { | 127 bool LoadRawBitmapsTo(const std::map<int, FilePath>& out_file_paths) { |
128 return theme_pack_->LoadRawBitmapsTo(out_file_paths, | 128 return theme_pack_->LoadRawBitmapsTo(out_file_paths, |
129 &theme_pack_->prepared_images_); | 129 &theme_pack_->images_on_ui_thread_); |
130 } | 130 } |
131 | 131 |
132 FilePath GetStarGazingPath() { | 132 FilePath GetStarGazingPath() { |
133 FilePath test_path; | 133 FilePath test_path; |
134 if (!PathService::Get(chrome::DIR_TEST_DATA, &test_path)) { | 134 if (!PathService::Get(chrome::DIR_TEST_DATA, &test_path)) { |
135 NOTREACHED(); | 135 NOTREACHED(); |
136 return test_path; | 136 return test_path; |
137 } | 137 } |
138 | 138 |
139 test_path = test_path.AppendASCII("profiles"); | 139 test_path = test_path.AppendASCII("profiles"); |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 | 423 |
424 // Part 2: Try to read back the data pack that we just wrote to disk. | 424 // Part 2: Try to read back the data pack that we just wrote to disk. |
425 { | 425 { |
426 scoped_refptr<BrowserThemePack> pack = | 426 scoped_refptr<BrowserThemePack> pack = |
427 BrowserThemePack::BuildFromDataPack( | 427 BrowserThemePack::BuildFromDataPack( |
428 file, "mblmlcbknbnfebdfjnolmcapmdofhmme"); | 428 file, "mblmlcbknbnfebdfjnolmcapmdofhmme"); |
429 ASSERT_TRUE(pack.get()); | 429 ASSERT_TRUE(pack.get()); |
430 VerifyStarGazing(pack.get()); | 430 VerifyStarGazing(pack.get()); |
431 } | 431 } |
432 } | 432 } |
OLD | NEW |