diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-26 19:50:15 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-26 19:50:15 +0000 |
commit | 0780e99ede69d2d7e3279898dc4651328836ec1e (patch) | |
tree | 0c96778454ad0ea33c4daaafc98a913493b9d918 | |
parent | 73b8a1ce654d9d0f82f02c1838f803f5ec345e7f (diff) | |
download | chromium_src-0780e99ede69d2d7e3279898dc4651328836ec1e.zip chromium_src-0780e99ede69d2d7e3279898dc4651328836ec1e.tar.gz chromium_src-0780e99ede69d2d7e3279898dc4651328836ec1e.tar.bz2 |
Move the BookmarkMenuController out of bookmarks to the platform-specific part
of chrome. This renames the _win version to _views and makes the header
compilable on non-Windows.
Review URL: http://codereview.chromium.org/113844
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16891 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/browser.vcproj | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.cc | 2 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_menu_controller_gtk.cc (renamed from chrome/browser/bookmarks/bookmark_menu_controller_gtk.cc) | 2 | ||||
-rw-r--r-- | chrome/browser/gtk/bookmark_menu_controller_gtk.h (renamed from chrome/browser/bookmarks/bookmark_menu_controller_gtk.h) | 6 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_menu_button.h | 2 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_menu_controller_views.cc (renamed from chrome/browser/bookmarks/bookmark_menu_controller_win.cc) | 12 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_menu_controller_views.h (renamed from chrome/browser/bookmarks/bookmark_menu_controller_win.h) | 11 | ||||
-rw-r--r-- | chrome/browser/views/browser_views.vcproj | 8 | ||||
-rw-r--r-- | chrome/chrome.gyp | 15 |
10 files changed, 36 insertions, 32 deletions
diff --git a/chrome/browser/browser.vcproj b/chrome/browser/browser.vcproj index 5d5404c..e0eebce 100644 --- a/chrome/browser/browser.vcproj +++ b/chrome/browser/browser.vcproj @@ -648,14 +648,6 @@ > </File> <File - RelativePath=".\bookmarks\bookmark_menu_controller_win.cc" - > - </File> - <File - RelativePath=".\bookmarks\bookmark_menu_controller_win.h" - > - </File> - <File RelativePath=".\bookmarks\bookmark_model.cc" > </File> diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index 24f2265..0d2122b 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -12,9 +12,9 @@ #include "base/pickle.h" #include "chrome/browser/bookmarks/bookmark_context_menu.h" #include "chrome/browser/bookmarks/bookmark_drag_data.h" -#include "chrome/browser/bookmarks/bookmark_menu_controller_gtk.h" #include "chrome/browser/bookmarks/bookmark_utils.h" #include "chrome/browser/browser.h" +#include "chrome/browser/gtk/bookmark_menu_controller_gtk.h" #include "chrome/browser/gtk/custom_button.h" #include "chrome/browser/gtk/dnd_registry.h" #include "chrome/browser/gtk/gtk_chrome_button.h" diff --git a/chrome/browser/bookmarks/bookmark_menu_controller_gtk.cc b/chrome/browser/gtk/bookmark_menu_controller_gtk.cc index 33ff46e..ca05738 100644 --- a/chrome/browser/bookmarks/bookmark_menu_controller_gtk.cc +++ b/chrome/browser/gtk/bookmark_menu_controller_gtk.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/bookmarks/bookmark_menu_controller_gtk.h" +#include "chrome/browser/gtk/bookmark_menu_controller_gtk.h" #include <gtk/gtk.h> diff --git a/chrome/browser/bookmarks/bookmark_menu_controller_gtk.h b/chrome/browser/gtk/bookmark_menu_controller_gtk.h index 8aef7eb..4d8e7b5 100644 --- a/chrome/browser/bookmarks/bookmark_menu_controller_gtk.h +++ b/chrome/browser/gtk/bookmark_menu_controller_gtk.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_GTK_H_ -#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_GTK_H_ +#ifndef CHROME_BROWSER_GTK_BOOKMARK_MENU_CONTROLLER_GTK_H_ +#define CHROME_BROWSER_GTK_BOOKMARK_MENU_CONTROLLER_GTK_H_ #include <gtk/gtk.h> @@ -98,4 +98,4 @@ class BookmarkMenuController : public BaseBookmarkModelObserver { DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); }; -#endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_GTK_H_ +#endif // CHROME_BROWSER_GTK_BOOKMARK_MENU_CONTROLLER_GTK_H_ diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h index b4a748b..f9a8c31 100644 --- a/chrome/browser/views/bookmark_bar_view.h +++ b/chrome/browser/views/bookmark_bar_view.h @@ -7,9 +7,9 @@ #include "app/slide_animation.h" #include "chrome/browser/bookmarks/bookmark_drag_data.h" -#include "chrome/browser/bookmarks/bookmark_menu_controller_win.h" #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/extensions/extensions_service.h" +#include "chrome/browser/views/bookmark_menu_controller_views.h" #include "chrome/common/notification_registrar.h" #include "views/controls/button/menu_button.h" #include "views/controls/label.h" diff --git a/chrome/browser/views/bookmark_menu_button.h b/chrome/browser/views/bookmark_menu_button.h index 3f2a98e..aeed549 100644 --- a/chrome/browser/views/bookmark_menu_button.h +++ b/chrome/browser/views/bookmark_menu_button.h @@ -7,7 +7,7 @@ #include "base/timer.h" #include "chrome/browser/bookmarks/bookmark_drag_data.h" -#include "chrome/browser/bookmarks/bookmark_menu_controller_win.h" +#include "chrome/browser/views/bookmark_menu_controller_views.h" #include "views/controls/button/menu_button.h" #include "views/controls/menu/view_menu_delegate.h" diff --git a/chrome/browser/bookmarks/bookmark_menu_controller_win.cc b/chrome/browser/views/bookmark_menu_controller_views.cc index 9788358..3f1fdd2 100644 --- a/chrome/browser/bookmarks/bookmark_menu_controller_win.cc +++ b/chrome/browser/views/bookmark_menu_controller_views.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/bookmarks/bookmark_menu_controller_win.h" +#include "chrome/browser/views/bookmark_menu_controller_views.h" #include "app/l10n_util.h" #include "app/os_exchange_data.h" @@ -21,14 +21,14 @@ BookmarkMenuController::BookmarkMenuController(Browser* browser, Profile* profile, PageNavigator* navigator, - HWND hwnd, + gfx::NativeWindow parent, BookmarkNode* node, int start_child_index, bool show_other_folder) : browser_(browser), profile_(profile), page_navigator_(navigator), - hwnd_(hwnd), + parent_(parent), node_(node), observer_(NULL), for_drop_(false), @@ -49,9 +49,9 @@ void BookmarkMenuController::RunMenuAt( for_drop_ = for_drop; profile_->GetBookmarkModel()->AddObserver(this); if (for_drop) { - menu_->RunMenuForDropAt(hwnd_, bounds, position); + menu_->RunMenuForDropAt(parent_, bounds, position); } else { - menu_->RunMenuAt(hwnd_, bounds, position, false); + menu_->RunMenuAt(parent_, bounds, position, false); delete this; } } @@ -160,7 +160,7 @@ bool BookmarkMenuController::ShowContextMenu(views::MenuItemView* source, std::vector<BookmarkNode*> nodes; nodes.push_back(menu_id_to_node_map_[id]); context_menu_.reset( - new BookmarkContextMenu(hwnd_, + new BookmarkContextMenu(parent_, profile_, browser_, page_navigator_, diff --git a/chrome/browser/bookmarks/bookmark_menu_controller_win.h b/chrome/browser/views/bookmark_menu_controller_views.h index 5263281..4764cd0 100644 --- a/chrome/browser/bookmarks/bookmark_menu_controller_win.h +++ b/chrome/browser/views/bookmark_menu_controller_views.h @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_WIN_H_ -#define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_WIN_H_ +#ifndef CHROME_BROWSER_VIEWS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ +#define CHROME_BROWSER_VIEWS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ #include <map> +#include "base/gfx/native_widget_types.h" #include "chrome/browser/bookmarks/base_bookmark_model_observer.h" #include "chrome/browser/bookmarks/bookmark_context_menu.h" #include "chrome/browser/bookmarks/bookmark_drag_data.h" @@ -37,7 +38,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver, BookmarkMenuController(Browser* browser, Profile* profile, PageNavigator* page_navigator, - HWND hwnd, + gfx::NativeWindow parent, BookmarkNode* node, int start_child_index, bool show_other_folder); @@ -109,7 +110,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver, PageNavigator* page_navigator_; // Parent of menus. - HWND hwnd_; + gfx::NativeWindow parent_; // The node we're showing the contents of. BookmarkNode* node_; @@ -142,4 +143,4 @@ class BookmarkMenuController : public BaseBookmarkModelObserver, DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); }; -#endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_WIN_H_ +#endif // CHROME_BROWSER_VIEWS_BOOKMARK_MENU_CONTROLLER_VIEWS_H_ diff --git a/chrome/browser/views/browser_views.vcproj b/chrome/browser/views/browser_views.vcproj index 4912e2f..d7aa394 100644 --- a/chrome/browser/views/browser_views.vcproj +++ b/chrome/browser/views/browser_views.vcproj @@ -516,6 +516,14 @@ > </File> <File + RelativePath=".\bookmark_menu_controller_views.cc" + > + </File> + <File + RelativePath=".\bookmark_menu_controller_views.h" + > + </File> + <File RelativePath=".\bookmark_table_view.cc" > </File> diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index cdee4fc..ef89d34 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -24,7 +24,7 @@ 'target_defaults': { 'sources/': [ ['exclude', '/(cocoa|gtk|win)/'], - ['exclude', '_(cocoa|gtk|linux|mac|posix|skia|win|x)\\.(cc|mm?)$'], + ['exclude', '_(cocoa|gtk|linux|mac|posix|skia|win|views|x)\\.(cc|mm?)$'], ['exclude', '/(gtk|win|x11)_[^/]*\\.cc$'], ], 'conditions': [ @@ -44,7 +44,10 @@ ['OS=="win"', {'sources/': [ ['include', '_(win)\\.cc$'], ['include', '/win/'], - ['include', '/win_[^/]*\\.cc$'], + ['include', '/(views|win)_[^/]*\\.cc$'], + ]}], + ['OS=="linux" and toolkit_views==1', {'sources/': [ + ['include', '/views_[^/]*\\.cc$'], ]}], ], }, @@ -578,10 +581,6 @@ 'browser/bookmarks/bookmark_index.h', 'browser/bookmarks/bookmark_html_writer.cc', 'browser/bookmarks/bookmark_html_writer.h', - 'browser/bookmarks/bookmark_menu_controller_gtk.cc', - 'browser/bookmarks/bookmark_menu_controller_gtk.h', - 'browser/bookmarks/bookmark_menu_controller_win.cc', - 'browser/bookmarks/bookmark_menu_controller_win.h', 'browser/bookmarks/bookmark_model.cc', 'browser/bookmarks/bookmark_model.h', 'browser/bookmarks/bookmark_service.h', @@ -883,6 +882,8 @@ 'browser/gtk/bookmark_bubble_gtk.h', 'browser/gtk/bookmark_editor_gtk.cc', 'browser/gtk/bookmark_editor_gtk.h', + 'browser/gtk/bookmark_menu_controller_gtk.cc', + 'browser/gtk/bookmark_menu_controller_gtk.h', 'browser/gtk/bookmark_tree_model.cc', 'browser/gtk/bookmark_tree_model.h', 'browser/gtk/browser_toolbar_gtk.cc', @@ -1366,6 +1367,8 @@ 'browser/views/bookmark_manager_view.h', 'browser/views/bookmark_menu_button.cc', 'browser/views/bookmark_menu_button.h', + 'browser/views/bookmark_menu_controller_views.cc', + 'browser/views/bookmark_menu_controller_views.h', 'browser/views/bookmark_table_view.cc', 'browser/views/bookmark_table_view.h', 'browser/views/browser_bubble.cc', |