Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4367)

Unified Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc

Issue 616253002: Extract NativeAppWindow from src/extensions Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: might fix athena. similarity=33 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc
index 497ac360d11903e78f32e2e64fdad8cac9b5d6eb..8bac7a35e5daafa35d6a02f10994a977e9c5ea2f 100644
--- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc
+++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc
@@ -35,8 +35,11 @@
#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
#include "ui/views/win/hwnd_util.h"
-ChromeNativeAppWindowViewsWin::ChromeNativeAppWindowViewsWin()
- : glass_frame_view_(NULL), weak_ptr_factory_(this) {
+ChromeNativeAppWindowViewsWin::ChromeNativeAppWindowViewsWin(
+ extensions::AppWindow* app_window)
+ : ChromeNativeAppWindowViews(app_window),
+ glass_frame_view_(NULL),
+ weak_ptr_factory_(this) {
}
void ChromeNativeAppWindowViewsWin::ActivateParentDesktopIfNecessary() {
@@ -76,8 +79,8 @@ void ChromeNativeAppWindowViewsWin::EnsureCaptionStyleSet() {
void ChromeNativeAppWindowViewsWin::OnBeforeWidgetInit(
views::Widget::InitParams* init_params,
views::Widget* widget) {
- content::BrowserContext* browser_context = app_window()->browser_context();
- std::string extension_id = app_window()->extension_id();
+ content::BrowserContext* browser_context = app_window()->GetBrowserContext();
+ std::string extension_id = extension_app_window()->extension_id();
// If an app has any existing windows, ensure new ones are created on the
// same desktop.
extensions::AppWindow* any_existing_window =
@@ -113,7 +116,8 @@ void ChromeNativeAppWindowViewsWin::InitializeDefaultWindow(
if (IsRunningInAsh())
return;
- const extensions::Extension* extension = app_window()->GetExtension();
+ const extensions::Extension* extension =
+ extension_app_window()->GetExtension();
if (!extension)
return;
@@ -122,7 +126,7 @@ void ChromeNativeAppWindowViewsWin::InitializeDefaultWindow(
base::string16 app_name_wide = base::UTF8ToWide(app_name);
HWND hwnd = GetNativeAppWindowHWND();
Profile* profile =
- Profile::FromBrowserContext(app_window()->browser_context());
+ Profile::FromBrowserContext(app_window()->GetBrowserContext());
app_model_id_ =
ShellIntegration::GetAppModelIdForProfile(app_name_wide,
profile->GetPath());
@@ -165,7 +169,8 @@ void ChromeNativeAppWindowViewsWin::UpdateShelfMenu() {
return;
}
- const extensions::Extension* extension = app_window()->GetExtension();
+ const extensions::Extension* extension =
+ extension_app_window()->GetExtension();
if (!extension)
return;
@@ -182,13 +187,13 @@ void ChromeNativeAppWindowViewsWin::UpdateShelfMenu() {
// Add item to install ephemeral apps.
if (extensions::util::IsEphemeralApp(extension->id(),
- app_window()->browser_context())) {
+ app_window()->GetBrowserContext())) {
scoped_refptr<ShellLinkItem> link(new ShellLinkItem());
link->set_title(l10n_util::GetStringUTF16(IDS_APP_INSTALL_TITLE));
link->set_icon(chrome_path.value(),
icon_resources::kInstallPackagedAppIndex);
ShellIntegration::AppendProfileArgs(
- app_window()->browser_context()->GetPath(), link->GetCommandLine());
+ app_window()->GetBrowserContext()->GetPath(), link->GetCommandLine());
link->GetCommandLine()->AppendSwitchASCII(switches::kInstallFromWebstore,
extension->id());

Powered by Google App Engine
This is Rietveld 408576698