Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(661)

Side by Side Diff: chrome/browser/themes/browser_theme_pack.cc

Issue 10412004: Revert "Revert 137734 - Select theme resources from ResourceBundle at requested scale factor." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | chrome/browser/themes/theme_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | chrome/browser/themes/theme_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698