| 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" |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 native_window_->HandleKeyboardEvent(event); | 282 native_window_->HandleKeyboardEvent(event); |
| 283 } | 283 } |
| 284 | 284 |
| 285 void ShellWindow::OnNativeClose() { | 285 void ShellWindow::OnNativeClose() { |
| 286 extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); | 286 extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); |
| 287 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); | 287 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); |
| 288 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); | 288 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); |
| 289 delete this; | 289 delete this; |
| 290 } | 290 } |
| 291 | 291 |
| 292 BaseWindow* ShellWindow::GetBaseWindow() { | 292 NativeShellWindow* ShellWindow::GetBaseWindow() { |
| 293 return native_window_.get(); | 293 return native_window_.get(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 gfx::NativeWindow ShellWindow::GetNativeWindow() { |
| 297 return GetBaseWindow()->GetNativeWindow(); |
| 298 } |
| 299 |
| 296 string16 ShellWindow::GetTitle() const { | 300 string16 ShellWindow::GetTitle() const { |
| 297 // WebContents::GetTitle() will return the page's URL if there's no <title> | 301 // WebContents::GetTitle() will return the page's URL if there's no <title> |
| 298 // specified. However, we'd prefer to show the name of the extension in that | 302 // specified. However, we'd prefer to show the name of the extension in that |
| 299 // case, so we directly inspect the NavigationEntry's title. | 303 // case, so we directly inspect the NavigationEntry's title. |
| 300 if (!web_contents()->GetController().GetActiveEntry() || | 304 if (!web_contents()->GetController().GetActiveEntry() || |
| 301 web_contents()->GetController().GetActiveEntry()->GetTitle().empty()) | 305 web_contents()->GetController().GetActiveEntry()->GetTitle().empty()) |
| 302 return UTF8ToUTF16(extension()->name()); | 306 return UTF8ToUTF16(extension()->name()); |
| 303 string16 title = web_contents()->GetTitle(); | 307 string16 title = web_contents()->GetTitle(); |
| 304 Browser::FormatTitleForDisplay(&title); | 308 Browser::FormatTitleForDisplay(&title); |
| 305 return title; | 309 return title; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 const extensions::DraggableRegion& region = *iter; | 511 const extensions::DraggableRegion& region = *iter; |
| 508 sk_region->op( | 512 sk_region->op( |
| 509 region.bounds.x(), | 513 region.bounds.x(), |
| 510 region.bounds.y(), | 514 region.bounds.y(), |
| 511 region.bounds.right(), | 515 region.bounds.right(), |
| 512 region.bounds.bottom(), | 516 region.bounds.bottom(), |
| 513 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); | 517 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); |
| 514 } | 518 } |
| 515 return sk_region; | 519 return sk_region; |
| 516 } | 520 } |
| OLD | NEW |