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 "content/shell/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "content/shell/browser/shell_browser_main_parts.h" | 32 #include "content/shell/browser/shell_browser_main_parts.h" |
33 #include "content/shell/browser/shell_content_browser_client.h" | 33 #include "content/shell/browser/shell_content_browser_client.h" |
34 #include "content/shell/browser/shell_devtools_frontend.h" | 34 #include "content/shell/browser/shell_devtools_frontend.h" |
35 #include "content/shell/browser/shell_javascript_dialog_manager.h" | 35 #include "content/shell/browser/shell_javascript_dialog_manager.h" |
36 #include "content/shell/common/shell_messages.h" | 36 #include "content/shell/common/shell_messages.h" |
37 #include "content/shell/common/shell_switches.h" | 37 #include "content/shell/common/shell_switches.h" |
38 #include "ui/gfx/display.h" | 38 #include "ui/gfx/display.h" |
39 #include "ui/gfx/switches.h" | 39 #include "ui/gfx/switches.h" |
40 | 40 |
41 #if defined(USE_X11) && !defined(OS_CHROMEOS) | 41 #if defined(USE_X11) && !defined(OS_CHROMEOS) |
42 #include "ui/views/widget/desktop_aura/desktop_screen_x11.h" | 42 #include "ui/views/test/desktop_screen_x11_test_api.h" |
43 #endif | 43 #endif |
44 | 44 |
45 namespace content { | 45 namespace content { |
46 | 46 |
47 const int kDefaultTestWindowWidthDip = 800; | 47 const int kDefaultTestWindowWidthDip = 800; |
48 const int kDefaultTestWindowHeightDip = 600; | 48 const int kDefaultTestWindowHeightDip = 600; |
49 | 49 |
50 std::vector<Shell*> Shell::windows_; | 50 std::vector<Shell*> Shell::windows_; |
51 base::Callback<void(Shell*)> Shell::shell_created_callback_; | 51 base::Callback<void(Shell*)> Shell::shell_created_callback_; |
52 | 52 |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 bool Shell::HandleContextMenu(const content::ContextMenuParams& params) { | 389 bool Shell::HandleContextMenu(const content::ContextMenuParams& params) { |
390 return PlatformHandleContextMenu(params); | 390 return PlatformHandleContextMenu(params); |
391 } | 391 } |
392 | 392 |
393 void Shell::SetDeviceScaleFactor(float scale) { | 393 void Shell::SetDeviceScaleFactor(float scale) { |
394 #if !defined(OS_CHROMEOS) | 394 #if !defined(OS_CHROMEOS) |
395 gfx::Display::ResetForceDeviceScaleFactorForTesting(); | 395 gfx::Display::ResetForceDeviceScaleFactorForTesting(); |
396 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( | 396 base::CommandLine::ForCurrentProcess()->AppendSwitchASCII( |
397 switches::kForceDeviceScaleFactor, base::StringPrintf("%f", scale)); | 397 switches::kForceDeviceScaleFactor, base::StringPrintf("%f", scale)); |
398 #if defined(USE_X11) | 398 #if defined(USE_X11) |
399 views::DesktopScreenX11::UpdateDeviceScaleFactorForTest(); | 399 views::test::DesktopScreenX11TestApi::UpdateDisplays(); |
400 #endif | 400 #endif |
401 #endif | 401 #endif |
402 RenderWidgetHostView* host_view = web_contents_->GetRenderWidgetHostView(); | 402 RenderWidgetHostView* host_view = web_contents_->GetRenderWidgetHostView(); |
403 host_view->SetSize(host_view->GetViewBounds().size()); | 403 host_view->SetSize(host_view->GetViewBounds().size()); |
404 } | 404 } |
405 | 405 |
406 gfx::Size Shell::GetShellDefaultSize() { | 406 gfx::Size Shell::GetShellDefaultSize() { |
407 static gfx::Size default_shell_size; | 407 static gfx::Size default_shell_size; |
408 if (!default_shell_size.IsEmpty()) | 408 if (!default_shell_size.IsEmpty()) |
409 return default_shell_size; | 409 return default_shell_size; |
(...skipping 26 matching lines...) Expand all Loading... |
436 devtools_frontend_->Activate(); | 436 devtools_frontend_->Activate(); |
437 devtools_frontend_->Focus(); | 437 devtools_frontend_->Focus(); |
438 } | 438 } |
439 | 439 |
440 void Shell::OnDevToolsWebContentsDestroyed() { | 440 void Shell::OnDevToolsWebContentsDestroyed() { |
441 devtools_observer_.reset(); | 441 devtools_observer_.reset(); |
442 devtools_frontend_ = NULL; | 442 devtools_frontend_ = NULL; |
443 } | 443 } |
444 | 444 |
445 } // namespace content | 445 } // namespace content |
OLD | NEW |