diff options
author | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-28 18:10:03 +0000 |
---|---|---|
committer | saintlou@chromium.org <saintlou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-28 18:10:03 +0000 |
commit | 3c21c833047b14ee1d033568bec9823ec1e43e4c (patch) | |
tree | a87ca9252d53937630de0bbfce9435ba303277a0 | |
parent | 94011294d49023ea9b64c6267bc4df1b7ba5bd33 (diff) | |
download | chromium_src-3c21c833047b14ee1d033568bec9823ec1e43e4c.zip chromium_src-3c21c833047b14ee1d033568bec9823ec1e43e4c.tar.gz chromium_src-3c21c833047b14ee1d033568bec9823ec1e43e4c.tar.bz2 |
Merge 159105 - This is the 3 following CLs collapsed as one (for easier merge in M23)
http://src.chromium.org/viewvc/chrome?view=rev&revision=158546
http://src.chromium.org/viewvc/chrome?view=rev&revision=158721
http://src.chromium.org/viewvc/chrome?view=rev&revision=158771
NOTE: this can only be landed *after* this has landed: https://codereview.chromium.org/10990091/
BUG=152003
TBR=oshima@chromium.org,derat@chromium.org,sky@chromium.org,jhorwich@chromium.org
Review URL: https://codereview.chromium.org/10993062
TBR=saintlou@chromium.org
Review URL: https://codereview.chromium.org/10993085
git-svn-id: svn://svn.chromium.org/chrome/branches/1271/src@159296 0039d316-1c4b-4281-b951-d872f2087c98
-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, 55 insertions, 32 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc index 7c43344..93ae641 100644 --- a/ash/accelerators/accelerator_controller.cc +++ b/ash/accelerators/accelerator_controller.cc @@ -719,13 +719,9 @@ bool AcceleratorController::PerformAction(int action, void AcceleratorController::SetBrightnessControlDelegate( scoped_ptr<BrightnessControlDelegate> 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); + // TODO(oshima): Show brightness control regardless of display type + // temporarily. crbug.com/152003. + 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 601389e..9f96207 100644 --- a/ash/accelerators/accelerator_controller_unittest.cc +++ b/ash/accelerators/accelerator_controller_unittest.cc @@ -713,16 +713,9 @@ 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); - { - 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)); - } + // TODO(oshima): Temporarily removed the tests for + // no internal display case. Add this back when + // re-enabling extended desktop. crbug.com/152003 // 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 ec2ae22..895ed99 100644 --- a/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc +++ b/chrome/browser/ui/webui/options/chromeos/display_options_handler.cc @@ -88,12 +88,9 @@ void DisplayOptionsHandler::OnDisplayRemoved(const gfx::Display& old_display) { } void DisplayOptionsHandler::UpdateDisplaySectionVisibility() { - 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); + // TODO(oshima): Temporarily disable the display options. + // crbug.com/152003. + base::FundamentalValue show_options(false); web_ui()->CallJavascriptFunction( "options.BrowserOptions.showDisplayOptions", show_options); } diff --git a/chromeos/display/output_configurator.cc b/chromeos/display/output_configurator.cc index 6fb573a..66a5b17 100644 --- a/chromeos/display/output_configurator.cc +++ b/chromeos/display/output_configurator.cc @@ -255,9 +255,11 @@ 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 = - OutputConfigurator::IsInternalOutputName( - std::string(output_info->name)); + name.find(kInternal_LVDS) == 0 || name.find(kInternal_eDP) == 0; VLOG(1) << "Found display #" << found_count << " with output " << (int)to_populate->output @@ -375,8 +377,13 @@ static OutputState GetNextState(Display* display, (0 != outputs[1].mirror_mode); switch (current_state) { case STATE_DUAL_PRIMARY_ONLY: - state = - mirror_supported ? STATE_DUAL_MIRROR : 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; break; case STATE_DUAL_MIRROR: state = STATE_DUAL_PRIMARY_ONLY; @@ -834,7 +841,9 @@ void OutputConfigurator::RemoveObserver(Observer* observer) { // static bool OutputConfigurator::IsInternalOutputName(const std::string& name) { - return name.find(kInternal_LVDS) == 0 || name.find(kInternal_eDP) == 0; + // TODO(oshima): There is only one display for m23 and no need to + // distinguish internal display. + return false; } void OutputConfigurator::NotifyOnDisplayChanged() { diff --git a/ui/aura/display_change_observer_x11.cc b/ui/aura/display_change_observer_x11.cc index af13460..a059d07 100644 --- a/ui/aura/display_change_observer_x11.cc +++ b/ui/aura/display_change_observer_x11.cc @@ -130,6 +130,12 @@ 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; @@ -166,6 +172,10 @@ void DisplayChangeObserverX11::NotifyDisplayChange() { displays.back().set_device_scale_factor(device_scale_factor); 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 dc76e68..459743b 100644 --- a/ui/aura/root_window_host_linux.cc +++ b/ui/aura/root_window_host_linux.cc @@ -497,11 +497,13 @@ bool RootWindowHostLinux::Dispatch(const base::NativeEvent& event) { if (client) { gfx::Point p = gfx::Screen::GetCursorScreenPoint(); client->ConvertPointFromScreen(root, &p); - if (root->ContainsPoint(p)) { + // TODO(oshima): Make sure the pointer is on one of root windows. + if (root->ContainsPoint(p)) root->ConvertPointToNativeScreen(&p); - XWarpPointer( - xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y()); - } + else + p.SetPoint(0, 0); + XWarpPointer( + xdisplay_, None, x_root_window_, 0, 0, 0, 0, p.x(), p.y()); } ConfineCursorToRootWindow(); } @@ -509,6 +511,22 @@ 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: |