OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/shell_window_views.h" | 5 #include "chrome/browser/ui/views/extensions/shell_window_views.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
| 9 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views
.h" |
9 #include "chrome/common/extensions/draggable_region.h" | 10 #include "chrome/common/extensions/draggable_region.h" |
10 #include "chrome/common/extensions/extension.h" | 11 #include "chrome/common/extensions/extension.h" |
11 #include "content/public/browser/render_view_host.h" | 12 #include "content/public/browser/render_view_host.h" |
12 #include "content/public/browser/render_widget_host_view.h" | 13 #include "content/public/browser/render_widget_host_view.h" |
13 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
14 #include "content/public/browser/web_contents_view.h" | 15 #include "content/public/browser/web_contents_view.h" |
15 #include "grit/ui_resources.h" | 16 #include "grit/ui_resources.h" |
16 #include "grit/ui_strings.h" // Accessibility names | 17 #include "grit/ui_strings.h" // Accessibility names |
17 #include "third_party/skia/include/core/SkPaint.h" | 18 #include "third_party/skia/include/core/SkPaint.h" |
18 #include "ui/base/hit_test.h" | 19 #include "ui/base/hit_test.h" |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 win_params.bounds); | 320 win_params.bounds); |
320 window_->SetBounds(window_bounds); | 321 window_->SetBounds(window_bounds); |
321 #if defined(OS_WIN) && !defined(USE_AURA) | 322 #if defined(OS_WIN) && !defined(USE_AURA) |
322 std::string app_name = web_app::GenerateApplicationNameFromExtensionId( | 323 std::string app_name = web_app::GenerateApplicationNameFromExtensionId( |
323 extension()->id()); | 324 extension()->id()); |
324 ui::win::SetAppIdForWindow( | 325 ui::win::SetAppIdForWindow( |
325 ShellIntegration::GetAppModelIdForProfile( | 326 ShellIntegration::GetAppModelIdForProfile( |
326 UTF8ToWide(app_name), shell_window_->profile()->GetPath()), | 327 UTF8ToWide(app_name), shell_window_->profile()->GetPath()), |
327 GetWidget()->GetTopLevelWidget()->GetNativeWindow()); | 328 GetWidget()->GetTopLevelWidget()->GetNativeWindow()); |
328 #endif | 329 #endif |
| 330 |
| 331 extension_keybinding_registry_.reset( |
| 332 new ExtensionKeybindingRegistryViews(shell_window_->profile(), |
| 333 window_->GetFocusManager(), |
| 334 extensions::ExtensionKeybindingRegistry::PLATFORM_APP_ONLY)); |
| 335 |
329 OnViewWasResized(); | 336 OnViewWasResized(); |
330 | 337 |
331 window_->Show(); | 338 window_->Show(); |
332 } | 339 } |
333 | 340 |
334 views::View* ShellWindowViews::GetInitiallyFocusedView() { | 341 views::View* ShellWindowViews::GetInitiallyFocusedView() { |
335 return web_view_; | 342 return web_view_; |
336 } | 343 } |
337 | 344 |
338 bool ShellWindowViews::ShouldDescendIntoChildForEventHandling( | 345 bool ShellWindowViews::ShouldDescendIntoChildForEventHandling( |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 region.bounds.bottom(), | 593 region.bounds.bottom(), |
587 SkRegion::kDifference_Op); | 594 SkRegion::kDifference_Op); |
588 } | 595 } |
589 | 596 |
590 draggable_region_.reset(draggable_region); | 597 draggable_region_.reset(draggable_region); |
591 OnViewWasResized(); | 598 OnViewWasResized(); |
592 } | 599 } |
593 | 600 |
594 void ShellWindowViews::HandleKeyboardEvent( | 601 void ShellWindowViews::HandleKeyboardEvent( |
595 const content::NativeWebKeyboardEvent& event) { | 602 const content::NativeWebKeyboardEvent& event) { |
596 // No-op. | 603 unhandled_keyboard_event_handler_.HandleKeyboardEvent(event, |
| 604 GetFocusManager()); |
597 } | 605 } |
598 | 606 |
599 // static | 607 // static |
600 NativeShellWindow* NativeShellWindow::Create( | 608 NativeShellWindow* NativeShellWindow::Create( |
601 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { | 609 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { |
602 return new ShellWindowViews(shell_window, params); | 610 return new ShellWindowViews(shell_window, params); |
603 } | 611 } |
OLD | NEW |