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 "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/extensions/app_window_contents.h" | 9 #include "chrome/browser/extensions/app_window_contents.h" |
10 #include "chrome/browser/extensions/extension_process_manager.h" | 10 #include "chrome/browser/extensions/extension_process_manager.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 ShellWindowContents* shell_window_contents, | 102 ShellWindowContents* shell_window_contents, |
103 const ShellWindow::CreateParams& params) { | 103 const ShellWindow::CreateParams& params) { |
104 // Initialize the render interface and web contents | 104 // Initialize the render interface and web contents |
105 shell_window_contents_.reset(shell_window_contents); | 105 shell_window_contents_.reset(shell_window_contents); |
106 shell_window_contents_->Initialize(profile(), url); | 106 shell_window_contents_->Initialize(profile(), url); |
107 WebContents* web_contents = shell_window_contents_->GetWebContents(); | 107 WebContents* web_contents = shell_window_contents_->GetWebContents(); |
108 WebContentsModalDialogManager::CreateForWebContents(web_contents); | 108 WebContentsModalDialogManager::CreateForWebContents(web_contents); |
109 FaviconTabHelper::CreateForWebContents(web_contents); | 109 FaviconTabHelper::CreateForWebContents(web_contents); |
110 | 110 |
111 web_contents->SetDelegate(this); | 111 web_contents->SetDelegate(this); |
| 112 WebContentsModalDialogManager::FromWebContents(web_contents)-> |
| 113 set_delegate(this); |
112 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_APP_SHELL); | 114 extensions::SetViewType(web_contents, extensions::VIEW_TYPE_APP_SHELL); |
113 | 115 |
114 // Initialize the window | 116 // Initialize the window |
115 window_type_ = params.window_type; | 117 window_type_ = params.window_type; |
116 | 118 |
117 gfx::Rect bounds = params.bounds; | 119 gfx::Rect bounds = params.bounds; |
118 | 120 |
119 if (bounds.width() == 0) | 121 if (bounds.width() == 0) |
120 bounds.set_width(kDefaultWidth); | 122 bounds.set_width(kDefaultWidth); |
121 if (bounds.height() == 0) | 123 if (bounds.height() == 0) |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 NOTREACHED() << "Received unexpected notification"; | 495 NOTREACHED() << "Received unexpected notification"; |
494 } | 496 } |
495 } | 497 } |
496 | 498 |
497 extensions::ActiveTabPermissionGranter* | 499 extensions::ActiveTabPermissionGranter* |
498 ShellWindow::GetActiveTabPermissionGranter() { | 500 ShellWindow::GetActiveTabPermissionGranter() { |
499 // Shell windows don't support the activeTab permission. | 501 // Shell windows don't support the activeTab permission. |
500 return NULL; | 502 return NULL; |
501 } | 503 } |
502 | 504 |
| 505 void ShellWindow::SetWebContentsBlocked(content::WebContents* web_contents, |
| 506 bool blocked) { |
| 507 } |
| 508 |
| 509 WebContentsModalDialogHost* ShellWindow::GetWebContentsModalDialogHost() { |
| 510 return native_app_window_.get(); |
| 511 } |
| 512 |
503 void ShellWindow::AddMessageToDevToolsConsole(ConsoleMessageLevel level, | 513 void ShellWindow::AddMessageToDevToolsConsole(ConsoleMessageLevel level, |
504 const std::string& message) { | 514 const std::string& message) { |
505 content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); | 515 content::RenderViewHost* rvh = web_contents()->GetRenderViewHost(); |
506 rvh->Send(new ExtensionMsg_AddMessageToConsole( | 516 rvh->Send(new ExtensionMsg_AddMessageToConsole( |
507 rvh->GetRoutingID(), level, message)); | 517 rvh->GetRoutingID(), level, message)); |
508 } | 518 } |
509 | 519 |
510 void ShellWindow::SaveWindowPosition() { | 520 void ShellWindow::SaveWindowPosition() { |
511 if (window_key_.empty()) | 521 if (window_key_.empty()) |
512 return; | 522 return; |
(...skipping 19 matching lines...) Expand all Loading... |
532 const extensions::DraggableRegion& region = *iter; | 542 const extensions::DraggableRegion& region = *iter; |
533 sk_region->op( | 543 sk_region->op( |
534 region.bounds.x(), | 544 region.bounds.x(), |
535 region.bounds.y(), | 545 region.bounds.y(), |
536 region.bounds.right(), | 546 region.bounds.right(), |
537 region.bounds.bottom(), | 547 region.bounds.bottom(), |
538 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 548 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
539 } | 549 } |
540 return sk_region; | 550 return sk_region; |
541 } | 551 } |
OLD | NEW |