| OLD | NEW | 
|   1 // Copyright 2015 The Chromium Authors. All rights reserved. |   1 // Copyright 2015 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 "blimp/client/app/blimp_startup.h" |   5 #include "blimp/client/app/blimp_startup.h" | 
|   6  |   6  | 
|   7 #include <string> |   7 #include <string> | 
|   8  |   8  | 
|   9 #include "base/command_line.h" |   9 #include "base/command_line.h" | 
|  10 #include "base/files/file_path.h" |  10 #include "base/files/file_path.h" | 
|  11 #include "base/lazy_instance.h" |  11 #include "base/lazy_instance.h" | 
|  12 #include "base/logging.h" |  12 #include "base/logging.h" | 
|  13 #include "base/message_loop/message_loop.h" |  13 #include "base/message_loop/message_loop.h" | 
|  14 #include "base/path_service.h" |  14 #include "base/path_service.h" | 
|  15 #include "blimp/client/app/blimp_discardable_memory_allocator.h" |  15 #include "blimp/client/app/blimp_discardable_memory_allocator.h" | 
|  16 #include "blimp/client/core/compositor/decoding_image_generator.h" |  16 #include "blimp/client/core/compositor/decoding_image_generator.h" | 
|  17 #include "third_party/skia/include/core/SkGraphics.h" |  17 #include "third_party/skia/include/core/SkGraphics.h" | 
 |  18 #include "ui/base/resource/resource_bundle.h" | 
|  18 #include "ui/gl/init/gl_factory.h" |  19 #include "ui/gl/init/gl_factory.h" | 
|  19  |  20  | 
|  20 class SkImageGenerator; |  21 class SkImageGenerator; | 
|  21  |  22  | 
|  22 namespace { |  23 namespace { | 
|  23 base::LazyInstance<std::unique_ptr<base::MessageLoopForUI>> |  24 base::LazyInstance<std::unique_ptr<base::MessageLoopForUI>> | 
|  24     g_main_message_loop = LAZY_INSTANCE_INITIALIZER; |  25     g_main_message_loop = LAZY_INSTANCE_INITIALIZER; | 
|  25  |  26  | 
|  26 base::LazyInstance<blimp::client::BlimpDiscardableMemoryAllocator> |  27 base::LazyInstance<blimp::client::BlimpDiscardableMemoryAllocator> | 
|  27     g_discardable_memory_allocator = LAZY_INSTANCE_INITIALIZER; |  28     g_discardable_memory_allocator = LAZY_INSTANCE_INITIALIZER; | 
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  74   base::DiscardableMemoryAllocator::SetInstance( |  75   base::DiscardableMemoryAllocator::SetInstance( | 
|  75       g_discardable_memory_allocator.Pointer()); |  76       g_discardable_memory_allocator.Pointer()); | 
|  76   if (!gl::init::InitializeGLOneOff()) |  77   if (!gl::init::InitializeGLOneOff()) | 
|  77     return false; |  78     return false; | 
|  78   SkGraphics::Init(); |  79   SkGraphics::Init(); | 
|  79   SkGraphics::SetImageGeneratorFromEncodedFactory(CreateImageGenerator); |  80   SkGraphics::SetImageGeneratorFromEncodedFactory(CreateImageGenerator); | 
|  80   g_main_message_loop.Get().reset(new base::MessageLoopForUI); |  81   g_main_message_loop.Get().reset(new base::MessageLoopForUI); | 
|  81   return true; |  82   return true; | 
|  82 } |  83 } | 
|  83  |  84  | 
 |  85 void InitializeResourceBundle() { | 
 |  86   // Load the pak file for the shell. | 
 |  87   base::FilePath pak_file; | 
 |  88   bool pak_file_valid = base::PathService::Get(base::DIR_MODULE, &pak_file); | 
 |  89   CHECK(pak_file_valid); | 
 |  90   pak_file = pak_file.Append(FILE_PATH_LITERAL("blimp_shell.pak")); | 
 |  91   ui::ResourceBundle::InitSharedInstanceWithPakPath(pak_file); | 
 |  92 } | 
 |  93  | 
|  84 }  // namespace client |  94 }  // namespace client | 
|  85 }  // namespace blimp |  95 }  // namespace blimp | 
| OLD | NEW |