| 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/plugins/plugin_observer.h" | 5 #include "chrome/browser/plugins/plugin_observer.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 // When non-active tabs are restored they are not added in view/window parent | 266 // When non-active tabs are restored they are not added in view/window parent |
| 267 // hierarchy (chrome::CreateRestoredTab/CreateParams). Normally we traverse | 267 // hierarchy (chrome::CreateRestoredTab/CreateParams). Normally we traverse |
| 268 // parent hierarchy to identify containing desktop (like in function | 268 // parent hierarchy to identify containing desktop (like in function |
| 269 // chrome::GetHostDesktopTypeForNativeView). | 269 // chrome::GetHostDesktopTypeForNativeView). |
| 270 // Possible issue with chrome::GetActiveDesktop, is that it's global | 270 // Possible issue with chrome::GetActiveDesktop, is that it's global |
| 271 // state, which remembers last active desktop, which may break in scenarios | 271 // state, which remembers last active desktop, which may break in scenarios |
| 272 // where we have instances on both Ash and Native desktop. | 272 // where we have instances on both Ash and Native desktop. |
| 273 | 273 |
| 274 // We will do both tests. Both have some factor of unreliability. | 274 // We will do both tests. Both have some factor of unreliability. |
| 275 aura::Window* window = web_contents()->GetNativeView(); | 275 aura::Window* window = web_contents()->GetNativeView(); |
| 276 if (chrome::GetActiveDesktop() == chrome::HOST_DESKTOP_TYPE_ASH || | 276 if (chrome::GetActiveDesktop() == ui::HOST_DESKTOP_TYPE_ASH || |
| 277 chrome::GetHostDesktopTypeForNativeView(window) == | 277 chrome::GetHostDesktopTypeForNativeView(window) == |
| 278 chrome::HOST_DESKTOP_TYPE_ASH) { | 278 ui::HOST_DESKTOP_TYPE_ASH) { |
| 279 int routing_id = render_frame_host->GetRoutingID(); | 279 int routing_id = render_frame_host->GetRoutingID(); |
| 280 render_frame_host->Send(new ChromeViewMsg_NPAPINotSupported(routing_id)); | 280 render_frame_host->Send(new ChromeViewMsg_NPAPINotSupported(routing_id)); |
| 281 } | 281 } |
| 282 #endif | 282 #endif |
| 283 } | 283 } |
| 284 | 284 |
| 285 void PluginObserver::PluginCrashed(const base::FilePath& plugin_path, | 285 void PluginObserver::PluginCrashed(const base::FilePath& plugin_path, |
| 286 base::ProcessId plugin_pid) { | 286 base::ProcessId plugin_pid) { |
| 287 DCHECK(!plugin_path.value().empty()); | 287 DCHECK(!plugin_path.value().empty()); |
| 288 | 288 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 scoped_ptr<PluginMetadata> plugin; | 421 scoped_ptr<PluginMetadata> plugin; |
| 422 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( | 422 bool ret = PluginFinder::GetInstance()->FindPluginWithIdentifier( |
| 423 identifier, NULL, &plugin); | 423 identifier, NULL, &plugin); |
| 424 DCHECK(ret); | 424 DCHECK(ret); |
| 425 | 425 |
| 426 PluginMetroModeInfoBarDelegate::Create( | 426 PluginMetroModeInfoBarDelegate::Create( |
| 427 InfoBarService::FromWebContents(web_contents()), | 427 InfoBarService::FromWebContents(web_contents()), |
| 428 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); | 428 PluginMetroModeInfoBarDelegate::DESKTOP_MODE_REQUIRED, plugin->name()); |
| 429 #endif | 429 #endif |
| 430 } | 430 } |
| OLD | NEW |