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/views/extensions/shell_window_views.h" | 5 #include "chrome/browser/ui/views/extensions/shell_window_views.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_host.h" | 8 #include "chrome/browser/extensions/extension_host.h" |
9 #include "chrome/browser/favicon/favicon_tab_helper.h" | 9 #include "chrome/browser/favicon/favicon_tab_helper.h" |
10 #include "chrome/browser/ui/tab_contents/tab_contents.h" | |
11 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views
.h" | 10 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views
.h" |
12 #include "chrome/common/extensions/draggable_region.h" | 11 #include "chrome/common/extensions/draggable_region.h" |
13 #include "chrome/common/extensions/extension.h" | 12 #include "chrome/common/extensions/extension.h" |
14 #include "content/public/browser/render_view_host.h" | 13 #include "content/public/browser/render_view_host.h" |
15 #include "content/public/browser/render_widget_host_view.h" | 14 #include "content/public/browser/render_widget_host_view.h" |
16 #include "content/public/browser/web_contents.h" | 15 #include "content/public/browser/web_contents.h" |
17 #include "content/public/browser/web_contents_view.h" | 16 #include "content/public/browser/web_contents_view.h" |
18 #include "grit/ui_resources.h" | 17 #include "grit/ui_resources.h" |
19 #include "grit/ui_strings.h" // Accessibility names | 18 #include "grit/ui_strings.h" // Accessibility names |
20 #include "third_party/skia/include/core/SkPaint.h" | 19 #include "third_party/skia/include/core/SkPaint.h" |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 587 |
589 gfx::ImageSkia ShellWindowViews::GetWindowAppIcon() { | 588 gfx::ImageSkia ShellWindowViews::GetWindowAppIcon() { |
590 gfx::Image app_icon = shell_window_->app_icon(); | 589 gfx::Image app_icon = shell_window_->app_icon(); |
591 if (app_icon.IsEmpty()) | 590 if (app_icon.IsEmpty()) |
592 return GetWindowIcon(); | 591 return GetWindowIcon(); |
593 else | 592 else |
594 return *app_icon.ToImageSkia(); | 593 return *app_icon.ToImageSkia(); |
595 } | 594 } |
596 | 595 |
597 gfx::ImageSkia ShellWindowViews::GetWindowIcon() { | 596 gfx::ImageSkia ShellWindowViews::GetWindowIcon() { |
598 TabContents* contents = shell_window_->tab_contents(); | 597 content::WebContents* web_contents = shell_window_->web_contents(); |
599 if (contents) { | 598 if (web_contents) { |
600 FaviconTabHelper* favicon_tab_helper = | 599 FaviconTabHelper* favicon_tab_helper = |
601 FaviconTabHelper::FromWebContents(contents->web_contents()); | 600 FaviconTabHelper::FromWebContents(web_contents); |
602 gfx::Image app_icon = favicon_tab_helper->GetFavicon(); | 601 gfx::Image app_icon = favicon_tab_helper->GetFavicon(); |
603 if (!app_icon.IsEmpty()) | 602 if (!app_icon.IsEmpty()) |
604 return *app_icon.ToImageSkia(); | 603 return *app_icon.ToImageSkia(); |
605 } | 604 } |
606 return gfx::ImageSkia(); | 605 return gfx::ImageSkia(); |
607 } | 606 } |
608 | 607 |
609 bool ShellWindowViews::ShouldShowWindowTitle() const { | 608 bool ShellWindowViews::ShouldShowWindowTitle() const { |
610 return false; | 609 return false; |
611 } | 610 } |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 ui::WindowShowState show_state) { | 643 ui::WindowShowState show_state) { |
645 views::WidgetDelegate::SaveWindowPlacement(bounds, show_state); | 644 views::WidgetDelegate::SaveWindowPlacement(bounds, show_state); |
646 shell_window_->SaveWindowPosition(); | 645 shell_window_->SaveWindowPosition(); |
647 } | 646 } |
648 | 647 |
649 // static | 648 // static |
650 NativeShellWindow* NativeShellWindow::Create( | 649 NativeShellWindow* NativeShellWindow::Create( |
651 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { | 650 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { |
652 return new ShellWindowViews(shell_window, params); | 651 return new ShellWindowViews(shell_window, params); |
653 } | 652 } |
OLD | NEW |