| Index: ash/display/display_layout_store.cc
|
| diff --git a/ash/display/display_layout_store.cc b/ash/display/display_layout_store.cc
|
| index 5ede80ba124b537da53ef568a519e1c6126ef9d2..7b074e00b8f3be30753f82391d73f1a7113fcfc2 100644
|
| --- a/ash/display/display_layout_store.cc
|
| +++ b/ash/display/display_layout_store.cc
|
| @@ -16,7 +16,7 @@
|
| namespace ash {
|
|
|
| DisplayLayoutStore::DisplayLayoutStore()
|
| - : default_display_placement_(DisplayPlacement::RIGHT, 0) {
|
| + : default_display_placement_(display::DisplayPlacement::RIGHT, 0) {
|
| base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| if (command_line->HasSwitch(switches::kAshSecondaryDisplayLayout)) {
|
| std::string value = command_line->GetSwitchValueASCII(
|
| @@ -25,13 +25,13 @@ DisplayLayoutStore::DisplayLayoutStore()
|
| int offset = 0;
|
| if (sscanf(value.c_str(), "%c,%d", &layout, &offset) == 2) {
|
| if (layout == 't')
|
| - default_display_placement_.position = DisplayPlacement::TOP;
|
| + default_display_placement_.position = display::DisplayPlacement::TOP;
|
| else if (layout == 'b')
|
| - default_display_placement_.position = DisplayPlacement::BOTTOM;
|
| + default_display_placement_.position = display::DisplayPlacement::BOTTOM;
|
| else if (layout == 'r')
|
| - default_display_placement_.position = DisplayPlacement::RIGHT;
|
| + default_display_placement_.position = display::DisplayPlacement::RIGHT;
|
| else if (layout == 'l')
|
| - default_display_placement_.position = DisplayPlacement::LEFT;
|
| + default_display_placement_.position = display::DisplayPlacement::LEFT;
|
| default_display_placement_.offset = offset;
|
| }
|
| }
|
| @@ -41,15 +41,15 @@ DisplayLayoutStore::~DisplayLayoutStore() {
|
| }
|
|
|
| void DisplayLayoutStore::SetDefaultDisplayPlacement(
|
| - const DisplayPlacement& placement) {
|
| + const display::DisplayPlacement& placement) {
|
| base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
| if (!command_line->HasSwitch(switches::kAshSecondaryDisplayLayout))
|
| default_display_placement_ = placement;
|
| }
|
|
|
| void DisplayLayoutStore::RegisterLayoutForDisplayIdList(
|
| - const DisplayIdList& list,
|
| - scoped_ptr<DisplayLayout> layout) {
|
| + const display::DisplayIdList& list,
|
| + scoped_ptr<display::DisplayLayout> layout) {
|
| // m50/51 dev/beta channel may have bad layout data saved in local state.
|
| // TODO(oshima): Consider removing this after m53.
|
| if (list.size() == 2 && layout->placement_list.size() > 1)
|
| @@ -71,27 +71,28 @@ void DisplayLayoutStore::RegisterLayoutForDisplayIdList(
|
| layout->placement_list[0].parent_display_id = list[0];
|
| }
|
| }
|
| - DCHECK(DisplayLayout::Validate(list, *layout.get()))
|
| + DCHECK(display::DisplayLayout::Validate(list, *layout.get()))
|
| << "ids=" << DisplayIdListToString(list)
|
| << ", layout=" << layout->ToString();
|
| layouts_[list] = std::move(layout);
|
| }
|
|
|
| -const DisplayLayout& DisplayLayoutStore::GetRegisteredDisplayLayout(
|
| - const DisplayIdList& list) {
|
| +const display::DisplayLayout& DisplayLayoutStore::GetRegisteredDisplayLayout(
|
| + const display::DisplayIdList& list) {
|
| DCHECK_NE(1u, list.size());
|
| const auto iter = layouts_.find(list);
|
| - const DisplayLayout* layout = iter != layouts_.end()
|
| - ? iter->second.get()
|
| - : CreateDefaultDisplayLayout(list);
|
| - DCHECK(DisplayLayout::Validate(list, *layout)) << layout->ToString();
|
| + const display::DisplayLayout* layout = iter != layouts_.end()
|
| + ? iter->second.get()
|
| + : CreateDefaultDisplayLayout(list);
|
| + DCHECK(display::DisplayLayout::Validate(list, *layout)) << layout->ToString();
|
| DCHECK_NE(layout->primary_id, gfx::Display::kInvalidDisplayID);
|
| return *layout;
|
| }
|
|
|
| -void DisplayLayoutStore::UpdateMultiDisplayState(const DisplayIdList& list,
|
| - bool mirrored,
|
| - bool default_unified) {
|
| +void DisplayLayoutStore::UpdateMultiDisplayState(
|
| + const display::DisplayIdList& list,
|
| + bool mirrored,
|
| + bool default_unified) {
|
| DCHECK(layouts_.find(list) != layouts_.end());
|
| if (layouts_.find(list) == layouts_.end())
|
| CreateDefaultDisplayLayout(list);
|
| @@ -100,14 +101,14 @@ void DisplayLayoutStore::UpdateMultiDisplayState(const DisplayIdList& list,
|
| layouts_[list]->default_unified = default_unified;
|
| }
|
|
|
| -DisplayLayout* DisplayLayoutStore::CreateDefaultDisplayLayout(
|
| - const DisplayIdList& list) {
|
| - scoped_ptr<DisplayLayout> layout(new DisplayLayout);
|
| +display::DisplayLayout* DisplayLayoutStore::CreateDefaultDisplayLayout(
|
| + const display::DisplayIdList& list) {
|
| + scoped_ptr<display::DisplayLayout> layout(new display::DisplayLayout);
|
| // The first display is the primary by default.
|
| layout->primary_id = list[0];
|
| layout->placement_list.clear();
|
| for (size_t i = 0; i < list.size() - 1; i++) {
|
| - DisplayPlacement placement(default_display_placement_);
|
| + display::DisplayPlacement placement(default_display_placement_);
|
| placement.display_id = list[i + 1];
|
| placement.parent_display_id = list[i];
|
| layout->placement_list.push_back(placement);
|
|
|