| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/views/apps/chrome_native_app_window_views.h" | 5 #include "chrome/browser/ui/views/apps/chrome_native_app_window_views.h" |
| 6 | 6 |
| 7 #include "apps/ui/views/app_window_frame_view.h" | 7 #include "apps/ui/views/app_window_frame_view.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/app_mode/app_mode_utils.h" | 10 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 11 #include "chrome/browser/chrome_page_zoom.h" | |
| 12 #include "chrome/browser/favicon/favicon_tab_helper.h" | 11 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/ui/host_desktop.h" | 13 #include "chrome/browser/ui/host_desktop.h" |
| 15 #include "chrome/browser/ui/views/apps/desktop_keyboard_capture.h" | 14 #include "chrome/browser/ui/views/apps/desktop_keyboard_capture.h" |
| 16 #include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h" | 15 #include "chrome/browser/ui/views/apps/shaped_app_window_targeter.h" |
| 17 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views
.h" | 16 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views
.h" |
| 18 #include "chrome/browser/ui/views/frame/taskbar_decorator.h" | 17 #include "chrome/browser/ui/views/frame/taskbar_decorator.h" |
| 19 #include "chrome/browser/web_applications/web_app.h" | 18 #include "chrome/browser/web_applications/web_app.h" |
| 20 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 20 #include "components/ui/zoom/page_zoom.h" |
| 21 #include "components/ui/zoom/zoom_controller.h" | 21 #include "components/ui/zoom/zoom_controller.h" |
| 22 #include "extensions/common/extension.h" | 22 #include "extensions/common/extension.h" |
| 23 #include "ui/aura/window.h" | 23 #include "ui/aura/window.h" |
| 24 #include "ui/base/hit_test.h" | 24 #include "ui/base/hit_test.h" |
| 25 #include "ui/base/models/simple_menu_model.h" | 25 #include "ui/base/models/simple_menu_model.h" |
| 26 #include "ui/gfx/image/image_skia.h" | 26 #include "ui/gfx/image/image_skia.h" |
| 27 #include "ui/views/controls/menu/menu_runner.h" | 27 #include "ui/views/controls/menu/menu_runner.h" |
| 28 #include "ui/views/controls/webview/webview.h" | 28 #include "ui/views/controls/webview/webview.h" |
| 29 #include "ui/views/widget/widget.h" | 29 #include "ui/views/widget/widget.h" |
| 30 #include "ui/wm/core/easy_resize_window_targeter.h" | 30 #include "ui/wm/core/easy_resize_window_targeter.h" |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 GetAcceleratorTable(); | 577 GetAcceleratorTable(); |
| 578 std::map<ui::Accelerator, int>::const_iterator iter = | 578 std::map<ui::Accelerator, int>::const_iterator iter = |
| 579 accelerator_table.find(accelerator); | 579 accelerator_table.find(accelerator); |
| 580 DCHECK(iter != accelerator_table.end()); | 580 DCHECK(iter != accelerator_table.end()); |
| 581 int command_id = iter->second; | 581 int command_id = iter->second; |
| 582 switch (command_id) { | 582 switch (command_id) { |
| 583 case IDC_CLOSE_WINDOW: | 583 case IDC_CLOSE_WINDOW: |
| 584 Close(); | 584 Close(); |
| 585 return true; | 585 return true; |
| 586 case IDC_ZOOM_MINUS: | 586 case IDC_ZOOM_MINUS: |
| 587 chrome_page_zoom::Zoom(web_view()->GetWebContents(), | 587 ui_zoom::PageZoom::Zoom(web_view()->GetWebContents(), |
| 588 content::PAGE_ZOOM_OUT); | 588 content::PAGE_ZOOM_OUT); |
| 589 return true; | 589 return true; |
| 590 case IDC_ZOOM_NORMAL: | 590 case IDC_ZOOM_NORMAL: |
| 591 chrome_page_zoom::Zoom(web_view()->GetWebContents(), | 591 ui_zoom::PageZoom::Zoom(web_view()->GetWebContents(), |
| 592 content::PAGE_ZOOM_RESET); | 592 content::PAGE_ZOOM_RESET); |
| 593 return true; | 593 return true; |
| 594 case IDC_ZOOM_PLUS: | 594 case IDC_ZOOM_PLUS: |
| 595 chrome_page_zoom::Zoom(web_view()->GetWebContents(), | 595 ui_zoom::PageZoom::Zoom(web_view()->GetWebContents(), |
| 596 content::PAGE_ZOOM_IN); | 596 content::PAGE_ZOOM_IN); |
| 597 return true; | 597 return true; |
| 598 default: | 598 default: |
| 599 NOTREACHED() << "Unknown accelerator sent to app window."; | 599 NOTREACHED() << "Unknown accelerator sent to app window."; |
| 600 } | 600 } |
| 601 return NativeAppWindowViews::AcceleratorPressed(accelerator); | 601 return NativeAppWindowViews::AcceleratorPressed(accelerator); |
| 602 } | 602 } |
| 603 | 603 |
| 604 // NativeAppWindow implementation. | 604 // NativeAppWindow implementation. |
| 605 | 605 |
| 606 void ChromeNativeAppWindowViews::SetFullscreen(int fullscreen_types) { | 606 void ChromeNativeAppWindowViews::SetFullscreen(int fullscreen_types) { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 InitializePanelWindow(create_params); | 707 InitializePanelWindow(create_params); |
| 708 } else { | 708 } else { |
| 709 InitializeDefaultWindow(create_params); | 709 InitializeDefaultWindow(create_params); |
| 710 } | 710 } |
| 711 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( | 711 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( |
| 712 Profile::FromBrowserContext(app_window->browser_context()), | 712 Profile::FromBrowserContext(app_window->browser_context()), |
| 713 widget()->GetFocusManager(), | 713 widget()->GetFocusManager(), |
| 714 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, | 714 extensions::ExtensionKeybindingRegistry::PLATFORM_APPS_ONLY, |
| 715 NULL)); | 715 NULL)); |
| 716 } | 716 } |
| OLD | NEW |