OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/json/json_writer.h" | 6 #include "base/json/json_writer.h" |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 registrar_.Add(this, | 88 registrar_.Add(this, |
89 NotificationType::LOAD_STOP, | 89 NotificationType::LOAD_STOP, |
90 Source<NavigationController>(&tab_contents_->controller())); | 90 Source<NavigationController>(&tab_contents_->controller())); |
91 registrar_.Add(this, | 91 registrar_.Add(this, |
92 NotificationType::TAB_CLOSING, | 92 NotificationType::TAB_CLOSING, |
93 Source<NavigationController>(&tab_contents_->controller())); | 93 Source<NavigationController>(&tab_contents_->controller())); |
94 registrar_.Add( | 94 registrar_.Add( |
95 this, | 95 this, |
96 NotificationType::BROWSER_THEME_CHANGED, | 96 NotificationType::BROWSER_THEME_CHANGED, |
97 Source<ThemeService>(ThemeServiceFactory::GetForProfile(profile_))); | 97 Source<ThemeService>(ThemeServiceFactory::GetForProfile(profile_))); |
98 TabContents* tab = inspected_rvh->delegate()->GetAsTabContents(); | 98 // There is now inspected_rvh in case of shared workers. |
99 if (tab) | 99 if (inspected_rvh) { |
100 inspected_tab_ = TabContentsWrapper::GetCurrentWrapperForContents(tab); | 100 TabContents* tab = inspected_rvh->delegate()->GetAsTabContents(); |
| 101 if (tab) |
| 102 inspected_tab_ = TabContentsWrapper::GetCurrentWrapperForContents(tab); |
| 103 } |
101 } | 104 } |
102 | 105 |
103 DevToolsWindow::~DevToolsWindow() { | 106 DevToolsWindow::~DevToolsWindow() { |
104 } | 107 } |
105 | 108 |
106 DevToolsWindow* DevToolsWindow::AsDevToolsWindow() { | 109 DevToolsWindow* DevToolsWindow::AsDevToolsWindow() { |
107 return this; | 110 return this; |
108 } | 111 } |
109 | 112 |
110 void DevToolsWindow::SendMessageToClient(const IPC::Message& message) { | 113 void DevToolsWindow::SendMessageToClient(const IPC::Message& message) { |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 if (docked_) { | 468 if (docked_) { |
466 if (event.windowsKeyCode == 0x08) { | 469 if (event.windowsKeyCode == 0x08) { |
467 // Do not navigate back in history on Windows (http://crbug.com/74156). | 470 // Do not navigate back in history on Windows (http://crbug.com/74156). |
468 return; | 471 return; |
469 } | 472 } |
470 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); | 473 BrowserWindow* inspected_window = GetInspectedBrowserWindow(); |
471 if (inspected_window) | 474 if (inspected_window) |
472 inspected_window->HandleKeyboardEvent(event); | 475 inspected_window->HandleKeyboardEvent(event); |
473 } | 476 } |
474 } | 477 } |
OLD | NEW |