Commit c6ff18dc authored by oshima's avatar oshima Committed by Commit bot

Move native_app_window_views* to components/native_app_window and fixed up build files.

 This will be used in athena.

BUG=414968
TBR=ben@chromium.org

Review URL: https://codereview.chromium.org/576863003

Cr-Commit-Position: refs/heads/master@{#295502}
parent 1762c8f9
...@@ -58,8 +58,6 @@ static_library("apps") { ...@@ -58,8 +58,6 @@ static_library("apps") {
sources += [ sources += [
"ui/views/app_window_frame_view.cc", "ui/views/app_window_frame_view.cc",
"ui/views/app_window_frame_view.h", "ui/views/app_window_frame_view.h",
"ui/views/native_app_window_views.cc",
"ui/views/native_app_window_views.h",
] ]
deps += [ deps += [
"//ui/strings", "//ui/strings",
......
...@@ -53,8 +53,6 @@ ...@@ -53,8 +53,6 @@
'switches.h', 'switches.h',
'ui/views/app_window_frame_view.cc', 'ui/views/app_window_frame_view.cc',
'ui/views/app_window_frame_view.h', 'ui/views/app_window_frame_view.h',
'ui/views/native_app_window_views.cc',
'ui/views/native_app_window_views.h',
], ],
'conditions': [ 'conditions': [
['chromeos==1', ['chromeos==1',
...@@ -76,6 +74,7 @@ ...@@ -76,6 +74,7 @@
], ],
['toolkit_views==1', { ['toolkit_views==1', {
'dependencies': [ 'dependencies': [
'../components/components.gyp:native_app_window',
'../ui/strings/ui_strings.gyp:ui_strings', '../ui/strings/ui_strings.gyp:ui_strings',
'../ui/views/views.gyp:views', '../ui/views/views.gyp:views',
], ],
......
...@@ -69,6 +69,7 @@ static_library("browser") { ...@@ -69,6 +69,7 @@ static_library("browser") {
"//components/metrics:gpu", "//components/metrics:gpu",
"//components/metrics:net", "//components/metrics:net",
"//components/metrics/proto:proto", "//components/metrics/proto:proto",
"//components/native_app_window",
"//components/navigation_metrics", "//components/navigation_metrics",
"//components/network_time", "//components/network_time",
"//components/omaha_query_params", "//components/omaha_query_params",
...@@ -230,6 +231,9 @@ static_library("browser") { ...@@ -230,6 +231,9 @@ static_library("browser") {
#"app_shim" TODO(GYP) #"app_shim" TODO(GYP)
] ]
} }
if (!toolkit_views) {
deps -= [ "//components/native_app_window" ]
}
if (cld2_data_source == "component") { if (cld2_data_source == "component") {
sources += [ sources += [
"component_updater/cld_component_installer.cc", "component_updater/cld_component_installer.cc",
......
...@@ -4,6 +4,7 @@ include_rules = [ ...@@ -4,6 +4,7 @@ include_rules = [
"+athena/screen/public", "+athena/screen/public",
"+athena/util", "+athena/util",
"+components/captive_portal", "+components/captive_portal",
"+components/native_app_window",
"+components/user_manager", "+components/user_manager",
# Library used for calculating CRC-32 needed for HWID verification. # Library used for calculating CRC-32 needed for HWID verification.
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "apps/ui/views/native_app_window_views.h"
#include "ash/desktop_background/desktop_background_controller.h" #include "ash/desktop_background/desktop_background_controller.h"
#include "ash/desktop_background/desktop_background_controller_observer.h" #include "ash/desktop_background/desktop_background_controller_observer.h"
#include "ash/shell.h" #include "ash/shell.h"
...@@ -48,6 +47,7 @@ ...@@ -48,6 +47,7 @@
#include "chromeos/chromeos_switches.h" #include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/cryptohome_client.h" #include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/disks/disk_mount_manager.h" #include "chromeos/disks/disk_mount_manager.h"
#include "components/native_app_window/native_app_window_views.h"
#include "components/signin/core/common/signin_pref_names.h" #include "components/signin/core/common/signin_pref_names.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h" #include "content/public/browser/notification_observer.h"
...@@ -643,8 +643,9 @@ IN_PROC_BROWSER_TEST_F(KioskTest, ZoomSupport) { ...@@ -643,8 +643,9 @@ IN_PROC_BROWSER_TEST_F(KioskTest, ZoomSupport) {
"window.domAutomationController.send(window.innerWidth);", "window.domAutomationController.send(window.innerWidth);",
&original_width)); &original_width));
apps::NativeAppWindowViews* native_app_window_views = native_app_window::NativeAppWindowViews* native_app_window_views =
static_cast<apps::NativeAppWindowViews*>(window->GetBaseWindow()); static_cast<native_app_window::NativeAppWindowViews*>(
window->GetBaseWindow());
ui::AcceleratorTarget* accelerator_target = ui::AcceleratorTarget* accelerator_target =
static_cast<ui::AcceleratorTarget*>(native_app_window_views); static_cast<ui::AcceleratorTarget*>(native_app_window_views);
......
include_rules = [
"+components/native_app_window"
]
...@@ -5,10 +5,14 @@ ...@@ -5,10 +5,14 @@
#ifndef CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ #ifndef CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_
#define CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_ #define CHROME_BROWSER_UI_VIEWS_APPS_CHROME_NATIVE_APP_WINDOW_VIEWS_H_
#include "apps/ui/views/native_app_window_views.h"
#include "base/memory/scoped_ptr.h" #include "base/memory/scoped_ptr.h"
#include "components/native_app_window/native_app_window_views.h"
#include "ui/views/context_menu_controller.h" #include "ui/views/context_menu_controller.h"
namespace apps {
class AppWindowFrameView;
}
#if defined(USE_ASH) #if defined(USE_ASH)
namespace ash { namespace ash {
class ImmersiveFullscreenController; class ImmersiveFullscreenController;
...@@ -21,8 +25,9 @@ namespace views { ...@@ -21,8 +25,9 @@ namespace views {
class MenuRunner; class MenuRunner;
} }
class ChromeNativeAppWindowViews : public apps::NativeAppWindowViews, class ChromeNativeAppWindowViews
public views::ContextMenuController { : public native_app_window::NativeAppWindowViews,
public views::ContextMenuController {
public: public:
ChromeNativeAppWindowViews(); ChromeNativeAppWindowViews();
virtual ~ChromeNativeAppWindowViews(); virtual ~ChromeNativeAppWindowViews();
......
...@@ -2992,6 +2992,11 @@ ...@@ -2992,6 +2992,11 @@
'browser/metrics/signin_status_metrics_provider.h', 'browser/metrics/signin_status_metrics_provider.h',
], ],
}], }],
['toolkit_views==1', {
'dependencies': [
'../components/components.gyp:native_app_window',
],
}],
['enable_extensions==1', { ['enable_extensions==1', {
'dependencies': [ 'dependencies': [
'browser_extensions', 'browser_extensions',
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/ui.gni")
# Collection of all components. You wouldn't link to this, but this is rather # Collection of all components. You wouldn't link to this, but this is rather
# to reference the files so they can be compiled by the build system. # to reference the files so they can be compiled by the build system.
...@@ -50,6 +51,7 @@ group("all_components") { ...@@ -50,6 +51,7 @@ group("all_components") {
"//components/language_usage_metrics", "//components/language_usage_metrics",
"//components/leveldb_proto", "//components/leveldb_proto",
"//components/metrics", "//components/metrics",
"//components/native_app_window",
"//components/navigation_interception", "//components/navigation_interception",
"//components/navigation_metrics", "//components/navigation_metrics",
"//components/network_time", "//components/network_time",
...@@ -111,6 +113,9 @@ group("all_components") { ...@@ -111,6 +113,9 @@ group("all_components") {
if (!is_chromeos) { if (!is_chromeos) {
deps -= [ "//components/pairing" ] deps -= [ "//components/pairing" ]
} }
if (!toolkit_views) {
deps -= [ "//components/native_app_window" ]
}
if (is_ios) { if (is_ios) {
deps -= [ "//components/keyed_service/content" ] deps -= [ "//components/keyed_service/content" ]
......
...@@ -96,6 +96,9 @@ per-file nacl*=mseaborn@chromium.org ...@@ -96,6 +96,9 @@ per-file nacl*=mseaborn@chromium.org
per-file nacl*=noelallen@chromium.org per-file nacl*=noelallen@chromium.org
per-file nacl*=teravest@chromium.org per-file nacl*=teravest@chromium.org
per-file native_app_window*=benwells@chromium.org
per-file native_app_window*=jamescook@chromium.org
per-file navigation_interception.gypi=mkosiba@chromium.org per-file navigation_interception.gypi=mkosiba@chromium.org
per-file network_time.gypi=zea@chromium.org per-file network_time.gypi=zea@chromium.org
......
...@@ -112,6 +112,11 @@ ...@@ -112,6 +112,11 @@
'invalidation.gypi', 'invalidation.gypi',
], ],
}], }],
['toolkit_views==1', {
'includes': [
'native_app_window.gypi',
],
}],
['enable_plugins==1', { ['enable_plugins==1', {
'includes': [ 'includes': [
'pdf.gypi', 'pdf.gypi',
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'native_app_window',
'type': 'static_library',
'dependencies': [
'../base/base.gyp:base',
'../content/content.gyp:content_browser',
'../extensions/extensions.gyp:extensions_browser',
'../extensions/extensions.gyp:extensions_common',
'../skia/skia.gyp:skia',
'../ui/views/views.gyp:views',
],
'include_dirs': [
'..',
],
'sources': [
'native_app_window/native_app_window_views.cc',
'native_app_window/native_app_window_views.h',
],
},
],
}
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
static_library("native_app_window") {
sources = [
"native_app_window_views.cc",
"native_app_window_views.h",
]
deps = [
"//base",
"//skia",
"//ui/views",
"//content/public/browser",
"//extensions/browser",
"//extensions/common",
]
}
include_rules = [
"+base",
"+content/public/browser",
"+extensions/browser/app_window",
"+extensions/common",
"+ui/aura",
"+ui/gfx",
"+ui/views",
"+third_party/skia/include/core/SkRegion.h",
]
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "apps/ui/views/native_app_window_views.h" #include "components/native_app_window/native_app_window_views.h"
#include "base/threading/sequenced_worker_pool.h" #include "base/threading/sequenced_worker_pool.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
...@@ -22,14 +22,15 @@ ...@@ -22,14 +22,15 @@
using extensions::AppWindow; using extensions::AppWindow;
namespace apps { namespace native_app_window {
NativeAppWindowViews::NativeAppWindowViews() NativeAppWindowViews::NativeAppWindowViews()
: app_window_(NULL), : app_window_(NULL),
web_view_(NULL), web_view_(NULL),
widget_(NULL), widget_(NULL),
frameless_(false), frameless_(false),
resizable_(false) {} resizable_(false) {
}
void NativeAppWindowViews::Init(AppWindow* app_window, void NativeAppWindowViews::Init(AppWindow* app_window,
const AppWindow::CreateParams& create_params) { const AppWindow::CreateParams& create_params) {
...@@ -71,7 +72,9 @@ void NativeAppWindowViews::InitializeWindow( ...@@ -71,7 +72,9 @@ void NativeAppWindowViews::InitializeWindow(
// ui::BaseWindow implementation. // ui::BaseWindow implementation.
bool NativeAppWindowViews::IsActive() const { return widget_->IsActive(); } bool NativeAppWindowViews::IsActive() const {
return widget_->IsActive();
}
bool NativeAppWindowViews::IsMaximized() const { bool NativeAppWindowViews::IsMaximized() const {
return widget_->IsMaximized(); return widget_->IsMaximized();
...@@ -121,19 +124,33 @@ void NativeAppWindowViews::ShowInactive() { ...@@ -121,19 +124,33 @@ void NativeAppWindowViews::ShowInactive() {
widget_->ShowInactive(); widget_->ShowInactive();
} }
void NativeAppWindowViews::Hide() { widget_->Hide(); } void NativeAppWindowViews::Hide() {
widget_->Hide();
}
void NativeAppWindowViews::Close() { widget_->Close(); } void NativeAppWindowViews::Close() {
widget_->Close();
}
void NativeAppWindowViews::Activate() { widget_->Activate(); } void NativeAppWindowViews::Activate() {
widget_->Activate();
}
void NativeAppWindowViews::Deactivate() { widget_->Deactivate(); } void NativeAppWindowViews::Deactivate() {
widget_->Deactivate();
}
void NativeAppWindowViews::Maximize() { widget_->Maximize(); } void NativeAppWindowViews::Maximize() {
widget_->Maximize();
}
void NativeAppWindowViews::Minimize() { widget_->Minimize(); } void NativeAppWindowViews::Minimize() {
widget_->Minimize();
}
void NativeAppWindowViews::Restore() { widget_->Restore(); } void NativeAppWindowViews::Restore() {
widget_->Restore();
}
void NativeAppWindowViews::SetBounds(const gfx::Rect& bounds) { void NativeAppWindowViews::SetBounds(const gfx::Rect& bounds) {
widget_->SetBounds(bounds); widget_->SetBounds(bounds);
...@@ -224,9 +241,13 @@ void NativeAppWindowViews::DeleteDelegate() { ...@@ -224,9 +241,13 @@ void NativeAppWindowViews::DeleteDelegate() {
app_window_->OnNativeClose(); app_window_->OnNativeClose();
} }
views::Widget* NativeAppWindowViews::GetWidget() { return widget_; } views::Widget* NativeAppWindowViews::GetWidget() {
return widget_;
}
const views::Widget* NativeAppWindowViews::GetWidget() const { return widget_; } const views::Widget* NativeAppWindowViews::GetWidget() const {
return widget_;
}
views::View* NativeAppWindowViews::GetContentsView() { views::View* NativeAppWindowViews::GetContentsView() {
return this; return this;
...@@ -319,9 +340,13 @@ bool NativeAppWindowViews::IsFullscreenOrPending() const { ...@@ -319,9 +340,13 @@ bool NativeAppWindowViews::IsFullscreenOrPending() const {
return widget_->IsFullscreen(); return widget_->IsFullscreen();
} }
void NativeAppWindowViews::UpdateWindowIcon() { widget_->UpdateWindowIcon(); } void NativeAppWindowViews::UpdateWindowIcon() {
widget_->UpdateWindowIcon();
}
void NativeAppWindowViews::UpdateWindowTitle() { widget_->UpdateWindowTitle(); } void NativeAppWindowViews::UpdateWindowTitle() {
widget_->UpdateWindowTitle();
}
void NativeAppWindowViews::UpdateBadgeIcon() { void NativeAppWindowViews::UpdateBadgeIcon() {
// Stub implementation. See also ChromeNativeAppWindowViews. // Stub implementation. See also ChromeNativeAppWindowViews.
...@@ -351,9 +376,13 @@ void NativeAppWindowViews::HandleKeyboardEvent( ...@@ -351,9 +376,13 @@ void NativeAppWindowViews::HandleKeyboardEvent(
GetFocusManager()); GetFocusManager());
} }
bool NativeAppWindowViews::IsFrameless() const { return frameless_; } bool NativeAppWindowViews::IsFrameless() const {
return frameless_;
}
bool NativeAppWindowViews::HasFrameColor() const { return false; } bool NativeAppWindowViews::HasFrameColor() const {
return false;
}
SkColor NativeAppWindowViews::ActiveFrameColor() const { SkColor NativeAppWindowViews::ActiveFrameColor() const {
return SK_ColorBLACK; return SK_ColorBLACK;
...@@ -378,11 +407,14 @@ gfx::Insets NativeAppWindowViews::GetFrameInsets() const { ...@@ -378,11 +407,14 @@ gfx::Insets NativeAppWindowViews::GetFrameInsets() const {
return window_bounds.InsetsFrom(client_bounds); return window_bounds.InsetsFrom(client_bounds);
} }
void NativeAppWindowViews::HideWithApp() {} void NativeAppWindowViews::HideWithApp() {
}
void NativeAppWindowViews::ShowWithApp() {} void NativeAppWindowViews::ShowWithApp() {
}
void NativeAppWindowViews::UpdateShelfMenu() {} void NativeAppWindowViews::UpdateShelfMenu() {
}
gfx::Size NativeAppWindowViews::GetContentMinimumSize() const { gfx::Size NativeAppWindowViews::GetContentMinimumSize() const {
return size_constraints_.GetMinimumSize(); return size_constraints_.GetMinimumSize();
...@@ -393,7 +425,8 @@ gfx::Size NativeAppWindowViews::GetContentMaximumSize() const { ...@@ -393,7 +425,8 @@ gfx::Size NativeAppWindowViews::GetContentMaximumSize() const {
} }
void NativeAppWindowViews::SetContentSizeConstraints( void NativeAppWindowViews::SetContentSizeConstraints(
const gfx::Size& min_size, const gfx::Size& max_size) { const gfx::Size& min_size,
const gfx::Size& max_size) {
size_constraints_.set_minimum_size(min_size); size_constraints_.set_minimum_size(min_size);
size_constraints_.set_maximum_size(max_size); size_constraints_.set_maximum_size(max_size);
widget_->OnSizeConstraintsChanged(); widget_->OnSizeConstraintsChanged();
...@@ -407,4 +440,4 @@ void NativeAppWindowViews::SetVisibleOnAllWorkspaces(bool always_visible) { ...@@ -407,4 +440,4 @@ void NativeAppWindowViews::SetVisibleOnAllWorkspaces(bool always_visible) {
widget_->SetVisibleOnAllWorkspaces(always_visible); widget_->SetVisibleOnAllWorkspaces(always_visible);
} }
} // namespace apps } // namespace native_app_window
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef APPS_UI_VIEWS_NATIVE_APP_WINDOW_VIEWS_H_ #ifndef COMPONENTS_NATIVE_APP_WINDOW_NATIVE_APP_WINDOW_VIEWS_H_
#define APPS_UI_VIEWS_NATIVE_APP_WINDOW_VIEWS_H_ #define COMPONENTS_NATIVE_APP_WINDOW_NATIVE_APP_WINDOW_VIEWS_H_
#include "base/observer_list.h" #include "base/observer_list.h"
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
...@@ -37,9 +37,7 @@ class MenuRunner; ...@@ -37,9 +37,7 @@ class MenuRunner;
class WebView; class WebView;
} }
namespace apps { namespace native_app_window {
class AppWindowFrameView;
// A NativeAppWindow backed by a views::Widget. This class may be used alone // A NativeAppWindow backed by a views::Widget. This class may be used alone
// as a stub or subclassed (for example, ChromeNativeAppWindowViews). // as a stub or subclassed (for example, ChromeNativeAppWindowViews).
...@@ -193,6 +191,6 @@ class NativeAppWindowViews : public extensions::NativeAppWindow, ...@@ -193,6 +191,6 @@ class NativeAppWindowViews : public extensions::NativeAppWindow,
DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews); DISALLOW_COPY_AND_ASSIGN(NativeAppWindowViews);
}; };
} // namespace apps } // namespace native_app_window
#endif // APPS_UI_VIEWS_NATIVE_APP_WINDOW_VIEWS_H_ #endif // COMPONENTS_NATIVE_APP_WINDOW_NATIVE_APP_WINDOW_VIEWS_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment