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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 WindowOpenDisposition disposition, | 582 WindowOpenDisposition disposition, |
583 const gfx::Rect& initial_pos, | 583 const gfx::Rect& initial_pos, |
584 bool user_gesture) { | 584 bool user_gesture) { |
585 if (inspected_tab_) { | 585 if (inspected_tab_) { |
586 inspected_tab_->web_contents()->GetDelegate()->AddNewContents( | 586 inspected_tab_->web_contents()->GetDelegate()->AddNewContents( |
587 source, new_contents, disposition, initial_pos, user_gesture); | 587 source, new_contents, disposition, initial_pos, user_gesture); |
588 } | 588 } |
589 } | 589 } |
590 | 590 |
591 bool DevToolsWindow::PreHandleKeyboardEvent( | 591 bool DevToolsWindow::PreHandleKeyboardEvent( |
| 592 content::WebContents* source, |
592 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { | 593 const NativeWebKeyboardEvent& event, bool* is_keyboard_shortcut) { |
593 if (docked_) { | 594 if (docked_) { |
594 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 595 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
595 if (inspected_window) | 596 if (inspected_window) |
596 return inspected_window->PreHandleKeyboardEvent( | 597 return inspected_window->PreHandleKeyboardEvent( |
597 event, is_keyboard_shortcut); | 598 event, is_keyboard_shortcut); |
598 } | 599 } |
599 return false; | 600 return false; |
600 } | 601 } |
601 | 602 |
602 void DevToolsWindow::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 603 void DevToolsWindow::HandleKeyboardEvent(content::WebContents* source, |
| 604 const NativeWebKeyboardEvent& event) { |
603 if (docked_) { | 605 if (docked_) { |
604 if (event.windowsKeyCode == 0x08) { | 606 if (event.windowsKeyCode == 0x08) { |
605 // Do not navigate back in history on Windows (http://crbug.com/74156). | 607 // Do not navigate back in history on Windows (http://crbug.com/74156). |
606 return; | 608 return; |
607 } | 609 } |
608 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 610 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
609 if (inspected_window) | 611 if (inspected_window) |
610 inspected_window->HandleKeyboardEvent(event); | 612 inspected_window->HandleKeyboardEvent(event); |
611 } | 613 } |
612 } | 614 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 } | 766 } |
765 | 767 |
766 void DevToolsWindow::UpdateBrowserToolbar() { | 768 void DevToolsWindow::UpdateBrowserToolbar() { |
767 if (!inspected_tab_) | 769 if (!inspected_tab_) |
768 return; | 770 return; |
769 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 771 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
770 if (inspected_window) | 772 if (inspected_window) |
771 inspected_window->UpdateToolbar(inspected_tab_, false); | 773 inspected_window->UpdateToolbar(inspected_tab_, false); |
772 } | 774 } |
773 | 775 |
OLD | NEW |