| 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/extensions/shell_window.h" | 5 #include "chrome/browser/ui/extensions/shell_window.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_process_manager.h" | 8 #include "chrome/browser/extensions/extension_process_manager.h" |
| 9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
| 10 #include "chrome/browser/extensions/shell_window_geometry_cache.h" | 10 #include "chrome/browser/extensions/shell_window_geometry_cache.h" |
| 11 #include "chrome/browser/extensions/shell_window_registry.h" | 11 #include "chrome/browser/extensions/shell_window_registry.h" |
| 12 #include "chrome/browser/extensions/tab_helper.h" |
| 12 #include "chrome/browser/file_select_helper.h" | 13 #include "chrome/browser/file_select_helper.h" |
| 13 #include "chrome/browser/infobars/infobar_tab_helper.h" | 14 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 14 #include "chrome/browser/intents/web_intents_util.h" | 15 #include "chrome/browser/intents/web_intents_util.h" |
| 15 #include "chrome/browser/lifetime/application_lifetime.h" | 16 #include "chrome/browser/lifetime/application_lifetime.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/sessions/session_id.h" | 18 #include "chrome/browser/sessions/session_id.h" |
| 18 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/browser_finder.h" | 20 #include "chrome/browser/ui/browser_finder.h" |
| 20 #include "chrome/browser/ui/browser_tabstrip.h" | 21 #include "chrome/browser/ui/browser_tabstrip.h" |
| 21 #include "chrome/browser/ui/browser_window.h" | 22 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 default: | 424 default: |
| 424 NOTREACHED() << "Received unexpected notification"; | 425 NOTREACHED() << "Received unexpected notification"; |
| 425 } | 426 } |
| 426 } | 427 } |
| 427 | 428 |
| 428 extensions::WindowController* | 429 extensions::WindowController* |
| 429 ShellWindow::GetExtensionWindowController() const { | 430 ShellWindow::GetExtensionWindowController() const { |
| 430 return NULL; | 431 return NULL; |
| 431 } | 432 } |
| 432 | 433 |
| 434 extensions::ActiveTabPermissionGranter* |
| 435 ShellWindow::GetActiveTabPermissionGranter() { |
| 436 // Shell windows don't support the activeTab permission. |
| 437 return NULL; |
| 438 } |
| 439 |
| 433 void ShellWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) { | 440 void ShellWindow::OnRequest(const ExtensionHostMsg_Request_Params& params) { |
| 434 extension_function_dispatcher_.Dispatch(params, | 441 extension_function_dispatcher_.Dispatch(params, |
| 435 web_contents_->GetRenderViewHost()); | 442 web_contents_->GetRenderViewHost()); |
| 436 } | 443 } |
| 437 | 444 |
| 438 void ShellWindow::AddMessageToDevToolsConsole(ConsoleMessageLevel level, | 445 void ShellWindow::AddMessageToDevToolsConsole(ConsoleMessageLevel level, |
| 439 const std::string& message) { | 446 const std::string& message) { |
| 440 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); | 447 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); |
| 441 rvh->Send(new ExtensionMsg_AddMessageToConsole( | 448 rvh->Send(new ExtensionMsg_AddMessageToConsole( |
| 442 rvh->GetRoutingID(), level, message)); | 449 rvh->GetRoutingID(), level, message)); |
| 443 } | 450 } |
| 444 | 451 |
| 445 void ShellWindow::SaveWindowPosition() | 452 void ShellWindow::SaveWindowPosition() |
| 446 { | 453 { |
| 447 if (window_key_.empty()) | 454 if (window_key_.empty()) |
| 448 return; | 455 return; |
| 449 | 456 |
| 450 extensions::ShellWindowGeometryCache* cache = | 457 extensions::ShellWindowGeometryCache* cache = |
| 451 extensions::ExtensionSystem::Get(profile())-> | 458 extensions::ExtensionSystem::Get(profile())-> |
| 452 shell_window_geometry_cache(); | 459 shell_window_geometry_cache(); |
| 453 | 460 |
| 454 gfx::Rect bounds = native_window_->GetBounds(); | 461 gfx::Rect bounds = native_window_->GetBounds(); |
| 455 cache->SaveGeometry(extension()->id(), window_key_, bounds); | 462 cache->SaveGeometry(extension()->id(), window_key_, bounds); |
| 456 } | 463 } |
| OLD | NEW |