Commit ba3ef5d7 authored by andresantoso's avatar andresantoso Committed by Commit bot

MacViews: Compile more Views source files.

A collection of small fixes towards getting MacViews browser to build, including:
* Modal dialogs expect a NativeView parent.
* Add BrowserNonClientFrameViewFactoryMac.
* Keyboard component not available without Aura.

BUG=425229

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

Cr-Commit-Position: refs/heads/master@{#308406}
parent 76e6d7f6
......@@ -4803,12 +4803,12 @@ Even if you have downloaded files from this website before, the website might ha
</message>
</if>
<if expr="chromeos">
<message name="IDS_EXTENSION_INSTALLED_MANAGE_INFO_CHROMEOS" desc="Text displayed in the InfoBubble with instructions on how to find the chrome://extensions/ management page on ChromeOS">
<message name="IDS_EXTENSION_INSTALLED_MANAGE_INFO" desc="Text displayed in the InfoBubble with instructions on how to find the chrome://extensions/ management page on ChromeOS">
Manage your extensions by clicking Extensions in the "More tools" menu.
</message>
</if>
<if expr="is_macosx">
<message name="IDS_EXTENSION_INSTALLED_MANAGE_INFO_MAC" desc="Text displayed in the InfoBubble with instructions on how to find the chrome://extensions/ management page on MAC OS X">
<message name="IDS_EXTENSION_INSTALLED_MANAGE_INFO" desc="Text displayed in the InfoBubble with instructions on how to find the chrome://extensions/ management page on MAC OS X">
Manage your extensions by clicking Extensions in the Window menu.
</message>
</if>
......
......@@ -167,7 +167,7 @@
<object class="NSTextFieldCell" key="NSCell" id="353810369">
<int key="NSCellFlags">67108864</int>
<int key="NSCellFlags2">272662528</int>
<string key="NSContents">^IDS_EXTENSION_INSTALLED_MANAGE_INFO_MAC</string>
<string key="NSContents">^IDS_EXTENSION_INSTALLED_MANAGE_INFO</string>
<reference key="NSSupport" ref="472995141"/>
<reference key="NSControlView" ref="480350025"/>
<object class="NSColor" key="NSBackgroundColor" id="951604798">
......
......@@ -486,7 +486,7 @@ bool CloudPrintFlowHandler::IsCloudPrintDialogUrl(const GURL& url) {
CloudPrintWebDialogDelegate::CloudPrintWebDialogDelegate(
content::BrowserContext* browser_context,
gfx::NativeWindow modal_parent,
gfx::NativeView modal_parent,
const base::RefCountedMemory* data,
const std::string& json_arguments,
const base::string16& print_job_title,
......@@ -617,7 +617,7 @@ bool CloudPrintWebDialogDelegate::HandleContextMenu(
// Called from the UI thread, starts up the dialog.
void CreateDialogImpl(content::BrowserContext* browser_context,
gfx::NativeWindow modal_parent,
gfx::NativeView modal_parent,
const base::RefCountedMemory* data,
const base::string16& print_job_title,
const base::string16& print_ticket,
......@@ -649,7 +649,7 @@ void CreateDialogImpl(content::BrowserContext* browser_context,
}
void CreateDialogForFileImpl(content::BrowserContext* browser_context,
gfx::NativeWindow modal_parent,
gfx::NativeView modal_parent,
const base::FilePath& path_to_file,
const base::string16& print_job_title,
const base::string16& print_ticket,
......@@ -696,7 +696,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
// the dialog.
void CreatePrintDialogForFile(content::BrowserContext* browser_context,
gfx::NativeWindow modal_parent,
gfx::NativeView modal_parent,
const base::FilePath& path_to_file,
const base::string16& print_job_title,
const base::string16& print_ticket,
......@@ -737,7 +737,7 @@ void CreateCloudPrintSigninTab(Browser* browser,
}
void CreatePrintDialogForBytes(content::BrowserContext* browser_context,
gfx::NativeWindow modal_parent,
gfx::NativeView modal_parent,
const base::RefCountedMemory* data,
const base::string16& print_job_title,
const base::string16& print_ticket,
......
......@@ -39,7 +39,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
// If non-NULL, |modal_parent| specifies a window that the print dialog is modal
// to.
void CreatePrintDialogForFile(content::BrowserContext* browser_context,
gfx::NativeWindow modal_parent,
gfx::NativeView modal_parent,
const base::FilePath& path_to_file,
const base::string16& print_job_title,
const base::string16& print_ticket,
......@@ -51,7 +51,7 @@ void CreatePrintDialogForFile(content::BrowserContext* browser_context,
// If non-NULL, |modal_parent| specifies a window that the print dialog is modal
// to.
void CreatePrintDialogForBytes(content::BrowserContext* browser_context,
gfx::NativeWindow modal_parent,
gfx::NativeView modal_parent,
const base::RefCountedMemory* data,
const base::string16& print_job_title,
const base::string16& print_ticket,
......
......@@ -146,7 +146,7 @@ class CloudPrintFlowHandler : public content::WebUIMessageHandler,
class CloudPrintWebDialogDelegate : public ui::WebDialogDelegate {
public:
CloudPrintWebDialogDelegate(content::BrowserContext* browser_context,
gfx::NativeWindow modal_parent,
gfx::NativeView modal_parent,
const base::RefCountedMemory* data,
const std::string& json_arguments,
const base::string16& print_job_title,
......@@ -178,7 +178,7 @@ class CloudPrintWebDialogDelegate : public ui::WebDialogDelegate {
const std::string& json_arguments);
CloudPrintFlowHandler* flow_handler_;
gfx::NativeWindow modal_parent_;
gfx::NativeView modal_parent_;
mutable bool owns_flow_handler_;
bool keep_alive_when_non_modal_;
......@@ -189,7 +189,7 @@ class CloudPrintWebDialogDelegate : public ui::WebDialogDelegate {
};
void CreateDialogForFileImpl(content::BrowserContext* browser_context,
gfx::NativeWindow modal_parent,
gfx::NativeView modal_parent,
const base::FilePath& path_to_file,
const base::string16& print_job_title,
const base::string16& print_ticket,
......
......@@ -336,11 +336,6 @@ static_library("ui") {
if (is_mac) {
sources +=
rebase_path(gypi_values.chrome_browser_ui_mac_sources, ".", "//chrome")
sources -= [
# Mac has its own way of drawing tabs.
"tabs/tab_resources.cc",
"tabs/tab_resources.h",
]
deps += [
"//third_party/google_toolbox_for_mac",
":generate_localizer",
......
......@@ -40,7 +40,7 @@ namespace chrome {
//
// Make sure to use the returned window only when you know it is safe
// to do so, i.e. before OnDialogClosed() is called on the delegate.
gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent,
gfx::NativeWindow ShowWebDialog(gfx::NativeView parent,
content::BrowserContext* context,
ui::WebDialogDelegate* delegate);
......
......@@ -96,7 +96,7 @@ private:
namespace chrome {
gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent,
gfx::NativeWindow ShowWebDialog(gfx::NativeView parent,
content::BrowserContext* context,
WebDialogDelegate* delegate) {
return [WebDialogWindowController showWebDialog:delegate
......
......@@ -11,7 +11,7 @@
namespace chrome {
// Declared in browser_dialogs.h so that others don't need to depend on our .h.
gfx::NativeWindow ShowWebDialog(gfx::NativeWindow parent,
gfx::NativeWindow ShowWebDialog(gfx::NativeView parent,
content::BrowserContext* context,
ui::WebDialogDelegate* delegate) {
views::Widget* widget = NULL;
......
......@@ -199,11 +199,7 @@ class InstalledBubbleContent : public views::View,
if (flavors_ & HOW_TO_MANAGE) {
manage_ = new views::Label(l10n_util::GetStringUTF16(
#if defined(OS_CHROMEOS)
IDS_EXTENSION_INSTALLED_MANAGE_INFO_CHROMEOS));
#else
IDS_EXTENSION_INSTALLED_MANAGE_INFO));
#endif
manage_->SetFontList(font_list);
manage_->SetMultiLine(true);
manage_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
......
// 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.
#include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h"
namespace chrome {
BrowserNonClientFrameView* CreateBrowserNonClientFrameView(
BrowserFrame* frame, BrowserView* browser_view) {
return new OpaqueBrowserFrameView(frame, browser_view);
}
} // namespace chrome
......@@ -10,7 +10,7 @@ bool OpaqueBrowserFrameViewPlatformSpecific::IsUsingSystemTheme() {
return false;
}
#if defined(OS_WIN)
#if !defined(OS_LINUX)
// static
OpaqueBrowserFrameViewPlatformSpecific*
......
......@@ -174,7 +174,7 @@ static const int kCentralColumnPadding =
// static
HungRendererDialogView* HungRendererDialogView::Create(
gfx::NativeView context) {
gfx::NativeWindow context) {
if (!g_instance_) {
g_instance_ = new HungRendererDialogView;
views::DialogDelegate::CreateDialogWidget(g_instance_, context, NULL);
......@@ -189,9 +189,9 @@ HungRendererDialogView* HungRendererDialogView::GetInstance() {
// static
bool HungRendererDialogView::IsFrameActive(WebContents* contents) {
gfx::NativeView frame_view =
gfx::NativeWindow window =
platform_util::GetTopLevel(contents->GetNativeView());
return platform_util::IsWindowActive(frame_view);
return platform_util::IsWindowActive(window);
}
// static
......@@ -236,10 +236,10 @@ void HungRendererDialogView::ShowForWebContents(WebContents* contents) {
GetWidget(), manager->GetWebContentsModalDialogHost());
}
gfx::NativeView frame_view =
gfx::NativeWindow window =
platform_util::GetTopLevel(contents->GetNativeView());
views::Widget* insert_after =
views::Widget::GetWidgetForNativeView(frame_view);
views::Widget::GetWidgetForNativeWindow(window);
if (insert_after)
GetWidget()->StackAboveWidget(insert_after);
......@@ -430,14 +430,16 @@ void ShowHungRendererDialog(WebContents* contents) {
if (logging::DialogsAreSuppressed())
return;
gfx::NativeView toplevel_view =
gfx::NativeWindow window =
platform_util::GetTopLevel(contents->GetNativeView());
#if defined(USE_AURA)
// Don't show the dialog if there is no root window for the renderer, because
// it's invisible to the user (happens when the renderer is for prerendering
// for example).
if (!toplevel_view->GetRootWindow())
if (!window->GetRootWindow())
return;
HungRendererDialogView* view = HungRendererDialogView::Create(toplevel_view);
#endif
HungRendererDialogView* view = HungRendererDialogView::Create(window);
view->ShowForWebContents(contents);
}
......
......@@ -99,7 +99,7 @@ class HungRendererDialogView : public views::DialogDelegateView,
public:
// Factory function for creating an instance of the HungRendererDialogView
// class. At any given point only one instance can be active.
static HungRendererDialogView* Create(gfx::NativeView context);
static HungRendererDialogView* Create(gfx::NativeWindow context);
// Returns a pointer to the singleton instance if any.
static HungRendererDialogView* GetInstance();
......
......@@ -346,11 +346,13 @@ void ToolbarView::ShowAppMenu(bool for_drop) {
if (wrench_menu_.get() && wrench_menu_->IsShowing())
return;
#if defined(USE_AURA)
if (keyboard::KeyboardController::GetInstance() &&
keyboard::KeyboardController::GetInstance()->keyboard_visible()) {
keyboard::KeyboardController::GetInstance()->HideKeyboard(
keyboard::KeyboardController::HIDE_REASON_AUTOMATIC);
}
#endif
wrench_menu_.reset(
new WrenchMenu(browser_, for_drop ? WrenchMenu::FOR_DROP : 0));
......
......@@ -2036,8 +2036,9 @@
'browser/ui/views/frame/browser_frame_mac.h',
'browser/ui/views/frame/browser_frame_mac.mm',
'browser/ui/views/frame/browser_non_client_frame_view.cc',
'browser/ui/views/frame/browser_non_client_frame_view_factory_aura.cc',
'browser/ui/views/frame/browser_non_client_frame_view.h',
'browser/ui/views/frame/browser_non_client_frame_view_factory_aura.cc',
'browser/ui/views/frame/browser_non_client_frame_view_factory_mac.mm',
'browser/ui/views/frame/browser_root_view.cc',
'browser/ui/views/frame/browser_root_view.h',
'browser/ui/views/frame/browser_shutdown.cc',
......@@ -2067,6 +2068,8 @@
'browser/ui/views/frame/native_browser_frame_factory_chromeos.cc',
'browser/ui/views/frame/native_browser_frame_factory_mac.cc',
'browser/ui/views/frame/native_browser_frame.h',
'browser/ui/views/frame/opaque_browser_frame_view.cc',
'browser/ui/views/frame/opaque_browser_frame_view.h',
'browser/ui/views/frame/opaque_browser_frame_view_layout.cc',
'browser/ui/views/frame/opaque_browser_frame_view_layout_delegate.h',
'browser/ui/views/frame/opaque_browser_frame_view_layout.h',
......@@ -2081,6 +2084,7 @@
'browser/ui/views/frame/system_menu_model_delegate.cc',
'browser/ui/views/frame/system_menu_model_delegate.h',
'browser/ui/views/frame/taskbar_decorator.h',
'browser/ui/views/frame/taskbar_decorator.cc',
'browser/ui/views/frame/taskbar_decorator_win.cc',
'browser/ui/views/frame/top_container_view.cc',
'browser/ui/views/frame/top_container_view.h',
......@@ -2320,8 +2324,6 @@
'browser/ui/views/external_protocol_dialog.h',
'browser/ui/views/frame/desktop_browser_frame_aura.cc',
'browser/ui/views/frame/desktop_browser_frame_aura.h',
'browser/ui/views/frame/opaque_browser_frame_view.cc',
'browser/ui/views/frame/opaque_browser_frame_view.h',
'browser/ui/views/message_center/message_center_frame_view.cc',
'browser/ui/views/message_center/message_center_frame_view.h',
'browser/ui/views/message_center/message_center_widget_delegate.h',
......@@ -2528,7 +2530,6 @@
'browser/ui/startup/autolaunch_prompt.cc',
'browser/ui/views/apps/chrome_apps_client_views.cc',
'browser/ui/views/apps/keyboard_hook_handler.cc',
'browser/ui/views/frame/taskbar_decorator.cc',
'browser/ui/webui/certificate_viewer_ui.cc',
'browser/ui/webui/certificate_viewer_ui.h',
'browser/ui/webui/certificate_viewer_webui.cc',
......@@ -2913,11 +2914,6 @@
['OS=="mac"', {
'sources': [ '<@(chrome_browser_ui_mac_sources)' ],
'sources!': [
# Mac has its own way of drawing tabs.
'browser/ui/tabs/tab_resources.cc',
'browser/ui/tabs/tab_resources.h',
'browser/ui/views/extensions/extension_view_views.cc',
'browser/ui/views/extensions/extension_view_views.h',
# Task manager has its own sources list. Leave out the views one.
'browser/ui/views/task_manager_view.cc',
],
......@@ -2981,6 +2977,9 @@
'../ui/views/views.gyp:views',
],
'sources': [ '<@(chrome_browser_ui_win_sources)' ],
'sources!': [
'browser/ui/views/frame/taskbar_decorator.cc'
],
'conditions': [
['win_use_allocator_shim==1', {
'dependencies': [
......
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