| 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/engine/app/blimp_engine_config.h" | 5 #include "blimp/engine/app/blimp_engine_config.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 13 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 16 #include "blimp/common/get_client_token.h" | 16 #include "blimp/common/get_client_auth_token.h" |
| 17 #include "cc/base/switches.h" | 17 #include "cc/base/switches.h" |
| 18 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
| 19 #include "ui/gl/gl_switches.h" | 19 #include "ui/gl/gl_switches.h" |
| 20 #include "ui/native_theme/native_theme_switches.h" | 20 #include "ui/native_theme/native_theme_switches.h" |
| 21 | 21 |
| 22 namespace blimp { | 22 namespace blimp { |
| 23 namespace engine { | 23 namespace engine { |
| 24 | 24 |
| 25 void SetCommandLineDefaults(base::CommandLine* command_line) { | 25 void SetCommandLineDefaults(base::CommandLine* command_line) { |
| 26 command_line->AppendSwitch(::switches::kEnableOverlayScrollbar); | 26 command_line->AppendSwitch(::switches::kEnableOverlayScrollbar); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 37 // Disable threaded animation since we don't support them right now. | 37 // Disable threaded animation since we don't support them right now. |
| 38 // (crbug/570376). | 38 // (crbug/570376). |
| 39 command_line->AppendSwitch(cc::switches::kDisableThreadedAnimation); | 39 command_line->AppendSwitch(cc::switches::kDisableThreadedAnimation); |
| 40 } | 40 } |
| 41 | 41 |
| 42 BlimpEngineConfig::~BlimpEngineConfig() {} | 42 BlimpEngineConfig::~BlimpEngineConfig() {} |
| 43 | 43 |
| 44 // static | 44 // static |
| 45 std::unique_ptr<BlimpEngineConfig> BlimpEngineConfig::Create( | 45 std::unique_ptr<BlimpEngineConfig> BlimpEngineConfig::Create( |
| 46 const base::CommandLine& cmd_line) { | 46 const base::CommandLine& cmd_line) { |
| 47 const std::string client_token = GetClientToken(cmd_line); | 47 const std::string client_auth_token = GetClientAuthToken(cmd_line); |
| 48 if (!client_token.empty()) { | 48 if (!client_auth_token.empty()) { |
| 49 return base::WrapUnique(new BlimpEngineConfig(client_token)); | 49 return base::WrapUnique(new BlimpEngineConfig(client_auth_token)); |
| 50 } | 50 } |
| 51 return nullptr; | 51 return nullptr; |
| 52 } | 52 } |
| 53 | 53 |
| 54 // static | 54 // static |
| 55 std::unique_ptr<BlimpEngineConfig> BlimpEngineConfig::CreateForTest( | 55 std::unique_ptr<BlimpEngineConfig> BlimpEngineConfig::CreateForTest( |
| 56 const std::string& client_token) { | 56 const std::string& client_auth_token) { |
| 57 return base::WrapUnique(new BlimpEngineConfig(client_token)); | 57 return base::WrapUnique(new BlimpEngineConfig(client_auth_token)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 const std::string& BlimpEngineConfig::client_token() const { | 60 const std::string& BlimpEngineConfig::client_auth_token() const { |
| 61 return client_token_; | 61 return client_auth_token_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 BlimpEngineConfig::BlimpEngineConfig(const std::string& client_token) | 64 BlimpEngineConfig::BlimpEngineConfig(const std::string& client_auth_token) |
| 65 : client_token_(client_token) {} | 65 : client_auth_token_(client_auth_token) {} |
| 66 | 66 |
| 67 } // namespace engine | 67 } // namespace engine |
| 68 } // namespace blimp | 68 } // namespace blimp |
| OLD | NEW |