Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: chrome/browser/debugger/devtools_window.cc

Issue 10837112: Add WebContents* to some more WebContentsDelegate methods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/debugger/devtools_window.h ('k') | chrome/browser/extensions/extension_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/debugger/devtools_window.h ('k') | chrome/browser/extensions/extension_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698