Permalink
Browse files

Merge pull request #587 from zhchbin/nw-rebase

[WIN] Fix build error of rebase.
  • Loading branch information...
2 parents e0484ca + 857143c commit 6ce3059603237e140a14616c0236e75851f19ead @rogerwang rogerwang committed Apr 5, 2013
View
@@ -287,6 +287,7 @@
},
},
},
+ 'msvs_disabled_warnings': [ 4800 ],
}], # OS=="win"
],
},
View
@@ -109,7 +109,7 @@ class Menu : public Base {
#elif defined(OS_WIN)
friend class nw::NativeWindowWin;
- void Rebuild(const gfx::NativeMenu *parent_menu = NULL);
+ void Rebuild(const HMENU *parent_menu = NULL);
// Flag to indicate the menu has been modified since last show, so we should
// rebuild the menu before next show.
View
@@ -140,25 +140,22 @@ void Menu::Popup(int x, int y, content::Shell* shell) {
views::Menu2::ALIGN_TOPLEFT);
}
-void Menu::Rebuild(const gfx::NativeMenu *parent_menu) {
+void Menu::Rebuild(const HMENU *parent_menu) {
if (is_menu_modified_) {
// Refresh menu before show.
- menu_->Rebuild();
+ menu_->Rebuild(NULL);
menu_->UpdateStates();
for (size_t index = 0; index < icon_bitmaps_.size(); ++index) {
::DeleteObject(icon_bitmaps_[index]);
}
icon_bitmaps_.clear();
- gfx::NativeMenu native_menu = parent_menu == NULL ?
+ HMENU native_menu = parent_menu == NULL ?
menu_->GetNativeMenu() : *parent_menu;
- int first_item_index =
- menu_model_->GetFirstItemIndex(native_menu);
- for (int menu_index = first_item_index;
- menu_index < first_item_index + menu_model_->GetItemCount();
- ++menu_index) {
- int model_index = menu_index - first_item_index;
+ for (int model_index = 0;
+ model_index < menu_model_->GetItemCount();
+ ++model_index) {
int command_id = menu_model_->GetCommandIdAt(model_index);
if (menu_model_->GetTypeAt(model_index) == ui::MenuModel::TYPE_COMMAND ||
@@ -20,7 +20,7 @@
#include "content/nw/src/api/menuitem/menuitem.h"
-#include "base/file_path.h"
+#include "base/files/file_path.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "content/nw/src/api/dispatcher_host.h"
@@ -80,7 +80,7 @@ void MenuItem::SetIcon(const std::string& icon) {
content::Shell* shell = content::Shell::FromRenderViewHost(
dispatcher_host()->render_view_host());
nw::Package* package = shell->GetPackage();
- package->GetImage(FilePath::FromUTF8Unsafe(icon), &icon_);
+ package->GetImage(base::FilePath::FromUTF8Unsafe(icon), &icon_);
}
void MenuItem::SetTooltip(const std::string& tooltip) {
View
@@ -20,7 +20,7 @@
#include "content/nw/src/api/tray/tray.h"
-#include "base/file_path.h"
+#include "base/files/file_path.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/status_icons/status_icon.h"
@@ -79,7 +79,7 @@ void Tray::SetIcon(const std::string& path) {
content::Shell* shell = content::Shell::FromRenderViewHost(
dispatcher_host()->render_view_host());
nw::Package* package = shell->GetPackage();
- package->GetImage(FilePath::FromUTF8Unsafe(path), &icon);
+ package->GetImage(base::FilePath::FromUTF8Unsafe(path), &icon);
if (!icon.IsEmpty())
status_icon_->SetImage(*icon.ToImageSkia());
@@ -24,7 +24,6 @@
#include "base/values.h"
#include "base/win/wrapped_window_proc.h"
#include "chrome/browser/platform_util.h"
-#include "chrome/common/extensions/draggable_region.h"
#include "content/nw/src/api/menu/menu.h"
#include "content/nw/src/browser/native_window_toolbar_win.h"
#include "content/nw/src/common/shell_switches.h"
@@ -33,6 +32,8 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_view.h"
+#include "extensions/common/draggable_region.h"
#include "third_party/skia/include/core/SkPaint.h"
#include "ui/base/hit_test.h"
#include "ui/base/win/hwnd_util.h"
@@ -610,7 +611,9 @@ void NativeWindowWin::OnViewWasResized() {
int height = sz.height(), width = sz.width();
gfx::Path path;
path.addRect(0, 0, width, height);
- SetWindowRgn(web_contents()->GetNativeView(), path.CreateNativeRegion(), 1);
+ SetWindowRgn(web_contents()->GetView()->GetNativeView(),
+ path.CreateNativeRegion(),
+ 1);
SkRegion* rgn = new SkRegion;
if (!window_->IsFullscreen()) {
@@ -42,21 +42,21 @@ namespace content {
void ShellDownloadManagerDelegate::ChooseDownloadPath(
int32 download_id,
const DownloadTargetCallback& callback,
- const FilePath& suggested_path) {
+ const base::FilePath& suggested_path) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DownloadItem* item = download_manager_->GetDownload(download_id);
if (!item || (item->GetState() != DownloadItem::IN_PROGRESS))
return;
- FilePath result;
+ base::FilePath result;
- std::wstring file_part = FilePath(suggested_path).BaseName().value();
+ std::wstring file_part = base::FilePath(suggested_path).BaseName().value();
wchar_t file_name[MAX_PATH];
base::wcslcpy(file_name, file_part.c_str(), arraysize(file_name));
OPENFILENAME save_as;
ZeroMemory(&save_as, sizeof(save_as));
save_as.lStructSize = sizeof(OPENFILENAME);
- save_as.hwndOwner = item->GetWebContents()->GetNativeView();
+ save_as.hwndOwner = item->GetWebContents()->GetView()->GetNativeView();
save_as.lpstrFile = file_name;
save_as.nMaxFile = arraysize(file_name);
@@ -69,7 +69,7 @@ void ShellDownloadManagerDelegate::ChooseDownloadPath(
OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST;
if (GetSaveFileName(&save_as))
- result = FilePath(std::wstring(save_as.lpstrFile));
+ result = base::FilePath(std::wstring(save_as.lpstrFile));
callback.Run(result, DownloadItem::TARGET_DISPOSITION_PROMPT,
DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, result);
@@ -97,7 +97,7 @@ ShellJavaScriptDialog::ShellJavaScriptDialog(
JavaScriptMessageType message_type,
const string16& message_text,
const string16& default_prompt_text,
- const JavaScriptDialogCreator::DialogClosedCallback& callback)
+ const JavaScriptDialogManager::DialogClosedCallback& callback)
: creator_(creator),
callback_(callback),
message_text_(message_text),
@@ -89,25 +89,6 @@ MediaInternals* MediaInternals::GetInstance() {
MediaInternals::~MediaInternals() {}
-void MediaInternals::OnDeleteAudioStream(void* host, int stream_id) {
-}
-
-void MediaInternals::OnSetAudioStreamPlaying(
- void* host, int stream_id, bool playing) {
-}
-
-void MediaInternals::OnSetAudioStreamStatus(
- void* host, int stream_id, const std::string& status) {
-}
-
-void MediaInternals::OnSetAudioStreamVolume(
- void* host, int stream_id, double volume) {
-}
-
-void MediaInternals::OnMediaEvent(
- int render_process_id, const media::MediaLogEvent& event) {
-}
-
void MediaInternals::OnCaptureDevicesOpened(
int render_process_id,
int render_view_id,
@@ -42,18 +42,6 @@ class MediaInternals : public content::MediaObserver {
static MediaInternals* GetInstance();
// Overridden from content::MediaObserver:
- virtual void OnDeleteAudioStream(void* host, int stream_id) OVERRIDE;
- virtual void OnSetAudioStreamPlaying(void* host,
- int stream_id,
- bool playing) OVERRIDE;
- virtual void OnSetAudioStreamStatus(void* host,
- int stream_id,
- const std::string& status) OVERRIDE;
- virtual void OnSetAudioStreamVolume(void* host,
- int stream_id,
- double volume) OVERRIDE;
- virtual void OnMediaEvent(int render_process_id,
- const media::MediaLogEvent& event) OVERRIDE;
virtual void OnCaptureDevicesOpened(
int render_process_id,
int render_view_id,
View
@@ -430,7 +430,7 @@ void Shell::DidNavigateMainFramePostCommit(WebContents* web_contents) {
window()->SetToolbarUrlEntry(web_contents->GetURL().spec());
}
-JavaScriptDialogManager* Shell::GetJavaScriptDialogCreator() {
+JavaScriptDialogManager* Shell::GetJavaScriptDialogManager() {
if (!dialog_creator_.get())
dialog_creator_.reset(new ShellJavaScriptDialogCreator());
return dialog_creator_.get();
View
@@ -146,7 +146,7 @@ class Shell : public WebContentsDelegate,
const FilePath& path) OVERRIDE;
virtual void DidNavigateMainFramePostCommit(
WebContents* web_contents) OVERRIDE;
- virtual JavaScriptDialogManager* GetJavaScriptDialogCreator() OVERRIDE;
+ virtual JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE;
virtual void RequestToLockMouse(WebContents* web_contents,
bool user_gesture,
bool last_unlocked_by_target) OVERRIDE;
@@ -43,7 +43,13 @@ string16 ShellContentClient::GetLocalizedString(int message_id) const {
base::StringPiece ShellContentClient::GetDataResource(
int resource_id,
ui::ScaleFactor scale_factor) const {
- return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id);
+ return ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
+ resource_id, scale_factor);
+}
+
+base::RefCountedStaticMemory* ShellContentClient::GetDataResourceBytes(
+ int resource_id) const {
+ return ResourceBundle::GetSharedInstance().LoadDataResourceBytes(resource_id);
}
gfx::Image& ShellContentClient::GetNativeImageNamed(int resource_id) const {
@@ -22,6 +22,8 @@ class ShellContentClient : public ContentClient {
virtual base::StringPiece GetDataResource(
int resource_id,
ui::ScaleFactor scale_factor) const OVERRIDE;
+ virtual base::RefCountedStaticMemory* GetDataResourceBytes(
+ int resource_id) const OVERRIDE;
virtual gfx::Image& GetNativeImageNamed(int resource_id) const OVERRIDE;
virtual bool CanHandleWhileSwappedOut(const IPC::Message& msg) OVERRIDE;
};

0 comments on commit 6ce3059

Please sign in to comment.