diff options
-rw-r--r-- | ash/accelerators/accelerator_controller.cc | 10 | ||||
-rw-r--r-- | ash/accelerators/accelerator_controller_unittest.cc | 13 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/chromeos/display_options_handler.cc | 9 | ||||
-rw-r--r-- | chromeos/display/output_configurator.cc | 19 | ||||
-rw-r--r-- | ui/aura/display_change_observer_x11.cc | 10 | ||||
-rw-r--r-- | ui/aura/root_window_host_linux.cc | 26 |
6 files changed, 32 insertions, 55 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index 74cce7b..81f9df4 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -731,9 +731,13 @@ bool AcceleratorController::PerformAction(int action, void AcceleratorController::SetBrightnessControlDelegate( scoped_ptr<BrightnessControlDelegate> brightness_control_delegate) { - // TODO(oshima): Show brightness control regardless of display type - // temporarily. crbug.com/152003. - brightness_control_delegate_.swap(brightness_control_delegate); + internal::MultiDisplayManager* display_manager = + static_cast<internal::MultiDisplayManager*>( + aura::Env::GetInstance()->display_manager()); + // Install brightness control delegate only when internal + // display exists. + if (display_manager->HasInternalDisplay()) + brightness_control_delegate_.swap(brightness_control_delegate); } void AcceleratorController::SetImeControlDelegate( diff --git a/ash/accelerators/accelerator_controller_unittest.cc b/ash/accelerators/accelerator_controller_unittest.cc index a7f3e19..fed2e14 100644 --- a/ash/accelerators/accelerator_controller_unittest.cc +++ b/ash/accelerators/accelerator_controller_unittest.cc @@ -713,9 +713,16 @@ TEST_F(AcceleratorControllerTest, GlobalAccelerators) { // Brightness const ui::Accelerator f6(ui::VKEY_F6, ui::EF_NONE); const ui::Accelerator f7(ui::VKEY_F7, ui::EF_NONE); - // TODO(oshima): Temporarily removed the tests for - // no internal display case. Add this back when - // re-enabling extended desktop. crbug.com/152003 + { + EXPECT_FALSE(GetController()->Process(f6)); + EXPECT_FALSE(GetController()->Process(f7)); + DummyBrightnessControlDelegate* delegate = + new DummyBrightnessControlDelegate(true); + GetController()->SetBrightnessControlDelegate( + scoped_ptr<BrightnessControlDelegate>(delegate).Pass()); + EXPECT_FALSE(GetController()->Process(f6)); + EXPECT_FALSE(GetController()->Process(f7)); + } // Enable internal display. EnableInternalDisplay(); { diff --git a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc index 92db9c1..6e5be0a 100644 --- a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc @@ -90,9 +90,12 @@ void DisplayOptionsHandler::OnDisplayRemoved(const gfx::Display& old_display) { } void DisplayOptionsHandler::UpdateDisplaySectionVisibility() { - // TODO(oshima): Temporarily disable the display options. - // crbug.com/152003. - base::FundamentalValue show_options(false); + chromeos::OutputState output_state = + ash::Shell::GetInstance()->output_configurator()->output_state(); + base::FundamentalValue show_options( + output_state != chromeos::STATE_INVALID && + output_state != chromeos::STATE_HEADLESS && + output_state != chromeos::STATE_SINGLE); web_ui()->CallJavascriptFunction( "options.BrowserOptions.showDisplayOptions", show_options); } diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc index 66a5b17..6fb573a 100644 --- a/chromeos/display/output_configurator.cc +++ b/chromeos/display/output_configurator.cc @@ -255,11 +255,9 @@ static int GetDualOutputs(Display* display, to_populate->mirror_mode = 0; // See if this output refers to an internal display. - // TODO(oshmia): Use |IsInternalOutputName| once the change is merged - // to m23. crbug.com/152003. - const std::string name(output_info->name); to_populate->is_internal = - name.find(kInternal_LVDS) == 0 || name.find(kInternal_eDP) == 0; + OutputConfigurator::IsInternalOutputName( + std::string(output_info->name)); VLOG(1) << "Found display #" << found_count << " with output " << (int)to_populate->output @@ -377,13 +375,8 @@ static OutputState GetNextState(Display* display, (0 != outputs[1].mirror_mode); switch (current_state) { case STATE_DUAL_PRIMARY_ONLY: - // TODO(oshima): Temporarily disable extended - // desktop. crbug.com/152003. - state = STATE_DUAL_SECONDARY_ONLY; - break; - case STATE_DUAL_SECONDARY_ONLY: - state = mirror_supported ? - STATE_DUAL_MIRROR : STATE_DUAL_PRIMARY_ONLY; + state = + mirror_supported ? STATE_DUAL_MIRROR : STATE_DUAL_PRIMARY_ONLY; break; case STATE_DUAL_MIRROR: state = STATE_DUAL_PRIMARY_ONLY; @@ -841,9 +834,7 @@ void OutputConfigurator::RemoveObserver(Observer* observer) { // static bool OutputConfigurator::IsInternalOutputName(const std::string& name) { - // TODO(oshima): There is only one display for m23 and no need to - // distinguish internal display. - return false; + return name.find(kInternal_LVDS) == 0 || name.find(kInternal_eDP) == 0; } void OutputConfigurator::NotifyOnDisplayChanged() { diff --git a/ui/aura/display_change_observer_x11.cc b/ui/aura/display_change_observer_x11.cc index ad2006d..21dab9c 100644 --- a/ui/aura/display_change_observer_x11.cc +++ b/ui/aura/display_change_observer_x11.cc @@ -130,12 +130,6 @@ void DisplayChangeObserverX11::NotifyDisplayChange() { LOG(WARNING) << "Crtc not found for output: output=" << o; continue; } - // TODO(oshima): Temporarily ignore all displays other than - // primary, which has y = 0 to disable extended desktop. - // crbug.com/152003. - if (crtc_info->y != 0) - continue; - XRRModeInfo* mode = FindMode(screen_resources, crtc_info->mode); if (!mode) { LOG(WARNING) << "Could not find a mode for the output: output=" << o; @@ -171,10 +165,6 @@ void DisplayChangeObserverX11::NotifyDisplayChange() { y_coords.insert(crtc_info->y); XRRFreeOutputInfo(output_info); - - // TODO(oshima): There is only one display in m23. - // Set the id to 0. crbug.com/152003. - displays.back().set_id(0); } // Free all allocated resources. diff --git a/ui/aura/root_window_host_linux.cc b/ui/aura/root_window_host_linux.cc index 52000cf..360c872 100644 --- a/ui/aura/root_window_host_linux.cc +++ b/ui/aura/root_window_host_linux.cc @@ -498,13 +498,11 @@ bool RootWindowHostLinux::Dispatch(const base::NativeEvent& event) { if (client) { gfx::Point p = gfx::Screen::GetCursorScreenPoint(); client->ConvertPointFromScreen(root, &p); - // TODO(oshima): Make sure the pointer is on one of root windows. - if (root->ContainsPoint(p)) + if (root->ContainsPoint(p)) { root->ConvertPointToNativeScreen(&p); - else - p.SetPoint(0, 0); - XWarpPointer( - xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y()); + XWarpPointer( + xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y()); + } } ConfineCursorToRootWindow(); } @@ -512,22 +510,6 @@ bool RootWindowHostLinux::Dispatch(const base::NativeEvent& event) { delegate_->OnHostResized(bounds.size()); if (origin_changed) delegate_->OnHostMoved(bounds_.origin()); -#if defined(OS_CHROMEOS) - // TODO(oshima): Clear the root when the window is moved or - // resized while the extended desktop is disabled. - // crbug.com/152003. - if (base::chromeos::IsRunningOnChromeOS()) { - XGCValues gc_values = {0}; - gc_values.foreground = BlackPixel(xdisplay_, DefaultScreen(xdisplay_)); - GC gc = XCreateGC(xdisplay_, x_root_window_, GCForeground, &gc_values); - XFillRectangle(xdisplay_, x_root_window_, gc, - x_root_bounds_.x(), - x_root_bounds_.y(), - x_root_bounds_.width(), - x_root_bounds_.height()); - XFreeGC(xdisplay_, gc); - } -#endif break; } case GenericEvent: |