| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdio.h> | 5 #include <stdio.h> |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/display/display_layout_store.h" | 8 #include "ash/display/display_layout_store.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "ui/gfx/display.h" | 11 #include "ui/gfx/display.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 namespace internal { | |
| 15 | 14 |
| 16 DisplayLayoutStore::DisplayLayoutStore() { | 15 DisplayLayoutStore::DisplayLayoutStore() { |
| 17 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 16 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 18 if (command_line->HasSwitch(switches::kAshSecondaryDisplayLayout)) { | 17 if (command_line->HasSwitch(switches::kAshSecondaryDisplayLayout)) { |
| 19 std::string value = command_line->GetSwitchValueASCII( | 18 std::string value = command_line->GetSwitchValueASCII( |
| 20 switches::kAshSecondaryDisplayLayout); | 19 switches::kAshSecondaryDisplayLayout); |
| 21 char layout; | 20 char layout; |
| 22 int offset = 0; | 21 int offset = 0; |
| 23 if (sscanf(value.c_str(), "%c,%d", &layout, &offset) == 2) { | 22 if (sscanf(value.c_str(), "%c,%d", &layout, &offset) == 2) { |
| 24 if (layout == 't') | 23 if (layout == 't') |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 82 } |
| 84 | 83 |
| 85 DisplayLayout DisplayLayoutStore::CreateDisplayLayout( | 84 DisplayLayout DisplayLayoutStore::CreateDisplayLayout( |
| 86 const DisplayIdPair& pair) { | 85 const DisplayIdPair& pair) { |
| 87 DisplayLayout layout = default_display_layout_; | 86 DisplayLayout layout = default_display_layout_; |
| 88 layout.primary_id = pair.first; | 87 layout.primary_id = pair.first; |
| 89 paired_layouts_[pair] = layout; | 88 paired_layouts_[pair] = layout; |
| 90 return layout; | 89 return layout; |
| 91 } | 90 } |
| 92 | 91 |
| 93 } // namespace internal | |
| 94 } // namespace ash | 92 } // namespace ash |
| OLD | NEW |