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

Side by Side Diff: chrome/common/chrome_content_client.cc

Issue 747923004: webui: minimize webui flicker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 6 years 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
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/common/chrome_content_client.h" 5 #include "chrome/common/chrome_content_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 16 matching lines...) Expand all
27 #include "content/public/common/content_constants.h" 27 #include "content/public/common/content_constants.h"
28 #include "content/public/common/content_switches.h" 28 #include "content/public/common/content_switches.h"
29 #include "content/public/common/url_constants.h" 29 #include "content/public/common/url_constants.h"
30 #include "content/public/common/user_agent.h" 30 #include "content/public/common/user_agent.h"
31 #include "extensions/common/constants.h" 31 #include "extensions/common/constants.h"
32 #include "gpu/config/gpu_info.h" 32 #include "gpu/config/gpu_info.h"
33 #include "net/http/http_util.h" 33 #include "net/http/http_util.h"
34 #include "ui/base/l10n/l10n_util.h" 34 #include "ui/base/l10n/l10n_util.h"
35 #include "ui/base/layout.h" 35 #include "ui/base/layout.h"
36 #include "ui/base/resource/resource_bundle.h" 36 #include "ui/base/resource/resource_bundle.h"
37 #include "ui/base/webui/web_ui_util.h"
37 38
38 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 39 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
39 40
40 #if defined(OS_WIN) 41 #if defined(OS_WIN)
41 #include "base/win/registry.h" 42 #include "base/win/registry.h"
42 #include "base/win/windows_version.h" 43 #include "base/win/windows_version.h"
43 #elif defined(OS_MACOSX) 44 #elif defined(OS_MACOSX)
44 #include "components/nacl/common/nacl_sandbox_type_mac.h" 45 #include "components/nacl/common/nacl_sandbox_type_mac.h"
45 #endif 46 #endif
46 47
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 ui::ScaleFactor scale_factor) const { 506 ui::ScaleFactor scale_factor) const {
506 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( 507 return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
507 resource_id, scale_factor); 508 resource_id, scale_factor);
508 } 509 }
509 510
510 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes( 511 base::RefCountedStaticMemory* ChromeContentClient::GetDataResourceBytes(
511 int resource_id) const { 512 int resource_id) const {
512 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id); 513 return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
513 } 514 }
514 515
516 content::WebUITextStyles ChromeContentClient::GetWebUITextStyles() const {
517 content::WebUITextStyles text_styles;
518 text_styles.font_family = webui::GetFontFamily();
519 text_styles.font_size = webui::GetFontSize();
520 text_styles.text_direction = webui::GetTextDirection();
521 return text_styles;
522 }
523
515 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const { 524 gfx::Image& ChromeContentClient::GetNativeImageNamed(int resource_id) const {
516 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id); 525 return ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
517 } 526 }
518 527
519 std::string ChromeContentClient::GetProcessTypeNameInEnglish(int type) { 528 std::string ChromeContentClient::GetProcessTypeNameInEnglish(int type) {
520 #if !defined(DISABLE_NACL) 529 #if !defined(DISABLE_NACL)
521 switch (type) { 530 switch (type) {
522 case PROCESS_TYPE_NACL_LOADER: 531 case PROCESS_TYPE_NACL_LOADER:
523 return "Native Client module"; 532 return "Native Client module";
524 case PROCESS_TYPE_NACL_BROKER: 533 case PROCESS_TYPE_NACL_BROKER:
(...skipping 10 matching lines...) Expand all
535 int sandbox_type, 544 int sandbox_type,
536 int* sandbox_profile_resource_id) const { 545 int* sandbox_profile_resource_id) const {
537 DCHECK(sandbox_profile_resource_id); 546 DCHECK(sandbox_profile_resource_id);
538 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { 547 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) {
539 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; 548 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE;
540 return true; 549 return true;
541 } 550 }
542 return false; 551 return false;
543 } 552 }
544 #endif 553 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698