diff options
Diffstat (limited to 'chrome')
21 files changed, 25 insertions, 363 deletions
diff --git a/chrome/app/theme/menu_bookmark.png b/chrome/app/theme/menu_bookmark.png Binary files differdeleted file mode 100644 index 71ceb98..0000000 --- a/chrome/app/theme/menu_bookmark.png +++ /dev/null diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd index 20da94d..b4ca9a1 100644 --- a/chrome/app/theme/theme_resources.grd +++ b/chrome/app/theme/theme_resources.grd @@ -278,7 +278,6 @@ <include name="IDR_DOCK_MAX" file="dock_tab_max.png" type="BINDATA" /> <include name="IDR_DOCK_HIGH" file="dock_tab_high.png" type="BINDATA" /> <include name="IDR_DOCK_WIDE" file="dock_tab_wide.png" type="BINDATA" /> - <include name="IDR_MENU_BOOKMARK" file="menu_bookmark.png" type="BINDATA" /> <include name="IDR_BUBBLE_L" file="bubble_l.png" type="BINDATA" /> <include name="IDR_BUBBLE_TL" file="bubble_tl.png" type="BINDATA" /> <include name="IDR_BUBBLE_T" file="bubble_t.png" type="BINDATA" /> diff --git a/chrome/browser/browser_theme_pack.cc b/chrome/browser/browser_theme_pack.cc index bf40435..f1f53eb 100644 --- a/chrome/browser/browser_theme_pack.cc +++ b/chrome/browser/browser_theme_pack.cc @@ -23,7 +23,7 @@ namespace { // Version number of the current theme pack. We just throw out and rebuild // theme packs that aren't int-equal to this. -const int kThemePackVersion = 11; +const int kThemePackVersion = 12; // IDs that are in the DataPack won't clash with the positive integer // int32_t. kHeaderID should always have the maximum value because we want the @@ -131,15 +131,14 @@ PersistingImagesTable kPersistingImages[] = { { 32, IDR_LOCATIONBG_C, NULL }, { 33, IDR_LOCATIONBG_L, NULL }, { 34, IDR_LOCATIONBG_R, NULL }, - { 35, IDR_MENU_BOOKMARK, NULL }, - { 36, IDR_MENU_PAGE, NULL }, - { 37, IDR_MENU_PAGE_RTL, NULL }, - { 38, IDR_MENU_CHROME, NULL }, - { 39, IDR_MENU_CHROME_RTL, NULL }, - { 40, IDR_MENU_DROPARROW, NULL }, - { 41, IDR_THROBBER, NULL }, - { 42, IDR_THROBBER_WAITING, NULL }, - { 43, IDR_THROBBER_LIGHT, NULL }, + { 35, IDR_MENU_PAGE, NULL }, + { 36, IDR_MENU_PAGE_RTL, NULL }, + { 37, IDR_MENU_CHROME, NULL }, + { 38, IDR_MENU_CHROME_RTL, NULL }, + { 39, IDR_MENU_DROPARROW, NULL }, + { 40, IDR_THROBBER, NULL }, + { 41, IDR_THROBBER_WAITING, NULL }, + { 42, IDR_THROBBER_LIGHT, NULL }, }; int GetPersistentIDByName(const std::string& key) { diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc index c11a181..452a2b8 100644 --- a/chrome/browser/browser_theme_provider.cc +++ b/chrome/browser/browser_theme_provider.cc @@ -146,7 +146,6 @@ const int kToolbarButtonIDs[] = { IDR_RELOAD, IDR_RELOAD_H, IDR_RELOAD_P, IDR_STOP, IDR_STOP_H, IDR_STOP_P, IDR_LOCATIONBG_C, IDR_LOCATIONBG_L, IDR_LOCATIONBG_R, - IDR_MENU_BOOKMARK, IDR_MENU_PAGE, IDR_MENU_PAGE_RTL, IDR_MENU_CHROME, IDR_MENU_CHROME_RTL, IDR_MENU_DROPARROW, diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index b4a6d77..57cc618 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -1325,13 +1325,11 @@ void BookmarkBarGtk::PopupForButton(GtkWidget* button) { } current_menu_.reset( - new BookmarkMenuController(browser_, profile_, - page_navigator_, + new BookmarkMenuController(browser_, profile_, page_navigator_, GTK_WINDOW(gtk_widget_get_toplevel(button)), node, button == overflow_button_ ? - first_hidden : 0, - false)); + first_hidden : 0)); menu_bar_helper_.MenuStartedShowing(button, current_menu_->widget()); GdkEvent* event = gtk_get_current_event(); current_menu_->Popup(button, event->button.button, event->button.time); diff --git a/chrome/browser/gtk/bookmark_menu_controller_gtk.cc b/chrome/browser/gtk/bookmark_menu_controller_gtk.cc index eff5391..71120d0 100644 --- a/chrome/browser/gtk/bookmark_menu_controller_gtk.cc +++ b/chrome/browser/gtk/bookmark_menu_controller_gtk.cc @@ -68,8 +68,7 @@ BookmarkMenuController::BookmarkMenuController(Browser* browser, PageNavigator* navigator, GtkWindow* window, const BookmarkNode* node, - int start_child_index, - bool show_other_folder) + int start_child_index) : browser_(browser), profile_(profile), page_navigator_(navigator), diff --git a/chrome/browser/gtk/bookmark_menu_controller_gtk.h b/chrome/browser/gtk/bookmark_menu_controller_gtk.h index c1c4517..1a31416 100644 --- a/chrome/browser/gtk/bookmark_menu_controller_gtk.h +++ b/chrome/browser/gtk/bookmark_menu_controller_gtk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -34,8 +34,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver, PageNavigator* page_navigator, GtkWindow* window, const BookmarkNode* node, - int start_child_index, - bool show_other_folder); + int start_child_index); virtual ~BookmarkMenuController(); GtkWidget* widget() { return menu_; } diff --git a/chrome/browser/gtk/view_id_util.cc b/chrome/browser/gtk/view_id_util.cc index 95ef79e..b3b70fc 100644 --- a/chrome/browser/gtk/view_id_util.cc +++ b/chrome/browser/gtk/view_id_util.cc @@ -95,9 +95,6 @@ const char* GetNameFromID(ViewID id) { case VIEW_ID_AUTOCOMPLETE: return "chrome-autocomplete-edit"; - case VIEW_ID_BOOKMARK_MENU: - return "chrome-bookmark-menu"; - case VIEW_ID_BOOKMARK_BAR: return "chrome-bookmark-bar"; diff --git a/chrome/browser/gtk/view_id_util_browsertest.cc b/chrome/browser/gtk/view_id_util_browsertest.cc index 6061528..c7a4aae 100644 --- a/chrome/browser/gtk/view_id_util_browsertest.cc +++ b/chrome/browser/gtk/view_id_util_browsertest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 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. @@ -33,10 +33,6 @@ IN_PROC_BROWSER_TEST_F(ViewIDTest, Basic) { browser()->ShowFindBar(); for (int i = VIEW_ID_TOOLBAR; i < VIEW_ID_PREDEFINED_COUNT; ++i) { - // http://crbug.com/21152 - if (i == VIEW_ID_BOOKMARK_MENU) - continue; - // Extension shelf is being removed, http://crbug.com/25106. if (i == VIEW_ID_DEV_EXTENSION_SHELF) continue; diff --git a/chrome/browser/view_ids.h b/chrome/browser/view_ids.h index 0ce057b..317c030 100644 --- a/chrome/browser/view_ids.h +++ b/chrome/browser/view_ids.h @@ -42,7 +42,6 @@ enum ViewID { VIEW_ID_PAGE_MENU, VIEW_ID_APP_MENU, VIEW_ID_AUTOCOMPLETE, - VIEW_ID_BOOKMARK_MENU, VIEW_ID_BROWSER_ACTION_TOOLBAR, // The Bookmark Bar. diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index c6caa97..a4de470 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -1176,9 +1176,8 @@ void BookmarkBarView::RunMenu(views::View* view, const gfx::Point& pt) { node = model_->GetBookmarkBarNode()->GetChild(button_index); } - bookmark_menu_ = new BookmarkMenuController( - browser_, profile_, page_navigator_, GetWindow()->GetNativeWindow(), - node, start_index, false); + bookmark_menu_ = new BookmarkMenuController(browser_, profile_, + page_navigator_, GetWindow()->GetNativeWindow(), node, start_index); bookmark_menu_->set_observer(this); bookmark_menu_->RunMenuAt(this, false); } @@ -1362,9 +1361,8 @@ void BookmarkBarView::ShowDropFolderForNode(const BookmarkNode* node) { start_index = GetFirstHiddenNodeIndex(); drop_info_->is_menu_showing = true; - bookmark_drop_menu_ = new BookmarkMenuController( - browser_, profile_, page_navigator_, GetWindow()->GetNativeWindow(), - node, start_index, false); + bookmark_drop_menu_ = new BookmarkMenuController(browser_, profile_, + page_navigator_, GetWindow()->GetNativeWindow(), node, start_index); bookmark_drop_menu_->set_observer(this); bookmark_drop_menu_->RunMenuAt(this, true); } diff --git a/chrome/browser/views/bookmark_menu_button.cc b/chrome/browser/views/bookmark_menu_button.cc deleted file mode 100644 index c9d17e4..0000000 --- a/chrome/browser/views/bookmark_menu_button.cc +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) 2010 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/views/bookmark_menu_button.h" - -#include "build/build_config.h" - -#if defined(OS_GTK) -#include <gtk/gtk.h> -#endif - -#include "app/os_exchange_data.h" -#include "app/resource_bundle.h" -#include "app/theme_provider.h" -#include "chrome/browser/bookmarks/bookmark_model.h" -#include "chrome/browser/bookmarks/bookmark_utils.h" -#include "chrome/browser/browser.h" -#include "chrome/browser/browser_theme_provider.h" -#include "chrome/browser/metrics/user_metrics.h" -#include "chrome/browser/profile.h" -#include "chrome/browser/tab_contents/tab_contents.h" -#include "chrome/browser/view_ids.h" -#include "grit/theme_resources.h" -#include "views/window/window.h" - -BookmarkMenuButton::BookmarkMenuButton(Browser* browser) - : views::MenuButton(NULL, std::wstring(), NULL, false), - browser_(browser), - bookmark_drop_menu_(NULL), - drop_operation_(0) { - // TODO(sky): if we keep this code, we need real icons, a11y support, and a - // tooltip. - set_menu_delegate(this); - SetID(VIEW_ID_BOOKMARK_MENU); - - ThemeProvider* tp = browser_->profile()->GetThemeProvider(); - SetIcon(*tp->GetBitmapNamed(IDR_MENU_BOOKMARK)); -} - -BookmarkMenuButton::~BookmarkMenuButton() { - if (bookmark_drop_menu_) - bookmark_drop_menu_->set_observer(NULL); -} - -bool BookmarkMenuButton::GetDropFormats( - int* formats, - std::set<OSExchangeData::CustomFormat>* custom_formats) { - BookmarkModel* bookmark_model = GetBookmarkModel(); - if (!bookmark_model || !bookmark_model->IsLoaded()) - return false; - - *formats = OSExchangeData::URL; - custom_formats->insert(BookmarkDragData::GetBookmarkCustomFormat()); - return true; -} - -bool BookmarkMenuButton::AreDropTypesRequired() { - return true; -} - -bool BookmarkMenuButton::CanDrop(const OSExchangeData& data) { - BookmarkModel* bookmark_model = GetBookmarkModel(); - if (!bookmark_model || !bookmark_model->IsLoaded()) - return false; - - drag_data_ = BookmarkDragData(); - // Only accept drops of 1 node, which is the case for all data dragged from - // bookmark bar and menus. - return drag_data_.Read(data) && drag_data_.has_single_url(); -} - -int BookmarkMenuButton::OnDragUpdated(const views::DropTargetEvent& event) { - if (!drag_data_.is_valid()) - return 0; - - BookmarkModel* bookmark_model = GetBookmarkModel(); - drop_operation_ = bookmark_utils::BookmarkDropOperation( - browser_->profile(), event, drag_data_, - bookmark_model->GetBookmarkBarNode(), - bookmark_model->GetBookmarkBarNode()->GetChildCount()); - if (drop_operation_ != 0) - StartShowFolderDropMenuTimer(); - else - StopShowFolderDropMenuTimer(); - return drop_operation_; -} - -void BookmarkMenuButton::OnDragExited() { - StopShowFolderDropMenuTimer(); - drag_data_ = BookmarkDragData(); -} - -int BookmarkMenuButton::OnPerformDrop(const views::DropTargetEvent& event) { - StopShowFolderDropMenuTimer(); - - if (bookmark_drop_menu_) - bookmark_drop_menu_->Cancel(); - - // Reset the drag data to take as little memory as needed. - BookmarkDragData data = drag_data_; - drag_data_ = BookmarkDragData(); - - if (!drop_operation_) - return DragDropTypes::DRAG_NONE; - - BookmarkModel* model = GetBookmarkModel(); - if (!model) - return DragDropTypes::DRAG_NONE; - - const BookmarkNode* parent = model->GetBookmarkBarNode(); - return bookmark_utils::PerformBookmarkDrop( - browser_->profile(), data, parent, parent->GetChildCount()); -} - -void BookmarkMenuButton::BookmarkMenuDeleted( - BookmarkMenuController* controller) { - bookmark_drop_menu_ = NULL; -} - -void BookmarkMenuButton::RunMenu(views::View* source, - const gfx::Point& pt) { - RunMenu(source, pt, GetWindow()->GetNativeWindow(), false); -} - -void BookmarkMenuButton::RunMenu(views::View* source, - const gfx::Point& pt, - gfx::NativeWindow hwnd, - bool for_drop) { - Profile* profile = browser_->profile(); - - UserMetrics::RecordAction(UserMetricsAction("BookmarkMenu_clicked"), - profile); - - BookmarkMenuController* menu = new BookmarkMenuController( - browser_, profile, browser_->GetSelectedTabContents(), hwnd, - GetBookmarkModel()->GetBookmarkBarNode(), 0, true); - - views::MenuItemView::AnchorPosition anchor = views::MenuItemView::TOPRIGHT; - if (base::i18n::IsRTL()) - anchor = views::MenuItemView::TOPLEFT; - if (for_drop) { - bookmark_drop_menu_ = menu; - bookmark_drop_menu_->set_observer(this); - } - menu->RunMenuAt(this, views::MenuItemView::TOPRIGHT, for_drop); -} - -BookmarkModel* BookmarkMenuButton::GetBookmarkModel() { - return browser_->profile()->GetBookmarkModel(); -} - -void BookmarkMenuButton::StartShowFolderDropMenuTimer() { - if (show_drop_menu_timer_.IsRunning()) - return; - -#if defined(OS_WIN) - static DWORD delay = 0; - if (!delay && !SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &delay, 0)) - delay = 400; -#else - static int delay = 400; -#endif - show_drop_menu_timer_.Start(base::TimeDelta::FromMilliseconds(delay), - this, &BookmarkMenuButton::ShowDropMenu); -} - -void BookmarkMenuButton::StopShowFolderDropMenuTimer() { - show_drop_menu_timer_.Stop(); -} - -void BookmarkMenuButton::ShowDropMenu() { - RunMenu(NULL, gfx::Point(), GetWindow()->GetNativeWindow(), true); -} diff --git a/chrome/browser/views/bookmark_menu_button.h b/chrome/browser/views/bookmark_menu_button.h deleted file mode 100644 index 2ac1fbd..0000000 --- a/chrome/browser/views/bookmark_menu_button.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) 2009 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. - -#ifndef CHROME_BROWSER_VIEWS_BOOKMARK_MENU_BUTTON_H_ -#define CHROME_BROWSER_VIEWS_BOOKMARK_MENU_BUTTON_H_ - -#include "base/timer.h" -#include "chrome/browser/bookmarks/bookmark_drag_data.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" - -class BookmarkModel; -class Browser; - -// BookmarkMenuButton is the button on the toolbar that when clicked shows -// all bookmarks in a menu. Additionally users can drag bookmarks over the -// button to have the menu appear. - -class BookmarkMenuButton : public views::MenuButton, - public BookmarkMenuController::Observer, - public views::ViewMenuDelegate { - public: - explicit BookmarkMenuButton(Browser* browser); - virtual ~BookmarkMenuButton(); - - // View drop methods. - virtual bool GetDropFormats( - int* formats, - std::set<OSExchangeData::CustomFormat>* custom_formats); - virtual bool AreDropTypesRequired(); - virtual bool CanDrop(const OSExchangeData& data); - virtual int OnDragUpdated(const views::DropTargetEvent& event); - virtual void OnDragExited(); - virtual int OnPerformDrop(const views::DropTargetEvent& event); - - // BookmarkMenuController::Observer. - virtual void BookmarkMenuDeleted(BookmarkMenuController* controller); - - // ViewMenuDelegate. - virtual void RunMenu(views::View* source, const gfx::Point& pt); - - private: - // Shows the menu. - void RunMenu(views::View* source, - const gfx::Point& pt, - gfx::NativeWindow hwnd, - bool for_drop); - - // Returns the bookmark model. - BookmarkModel* GetBookmarkModel(); - - // Starts the timer for showing the drop menu if it isn't running. - void StartShowFolderDropMenuTimer(); - - // Stops the timer for showing the drop menu. - void StopShowFolderDropMenuTimer(); - - // Shows the drop menu. - void ShowDropMenu(); - - // Browser used to determine profile for showing bookmarks from. - Browser* browser_; - - // Contents of current drag. - BookmarkDragData drag_data_; - - // Menu shown during drag and drop. - BookmarkMenuController* bookmark_drop_menu_; - - // Drop operation for current drop. - int drop_operation_; - - // Timer used for showing the drop menu. - base::OneShotTimer<BookmarkMenuButton> show_drop_menu_timer_; - - DISALLOW_COPY_AND_ASSIGN(BookmarkMenuButton); -}; - -#endif // CHROME_BROWSER_VIEWS_BOOKMARK_MENU_BUTTON_H_ diff --git a/chrome/browser/views/bookmark_menu_controller_views.cc b/chrome/browser/views/bookmark_menu_controller_views.cc index 09e5e48..372fa68 100644 --- a/chrome/browser/views/bookmark_menu_controller_views.cc +++ b/chrome/browser/views/bookmark_menu_controller_views.cc @@ -29,8 +29,7 @@ BookmarkMenuController::BookmarkMenuController(Browser* browser, PageNavigator* navigator, gfx::NativeWindow parent, const BookmarkNode* node, - int start_child_index, - bool show_other_folder) + int start_child_index) : browser_(browser), profile_(profile), page_navigator_(navigator), @@ -39,7 +38,6 @@ BookmarkMenuController::BookmarkMenuController(Browser* browser, menu_(NULL), observer_(NULL), for_drop_(false), - show_other_folder_(show_other_folder), bookmark_bar_(NULL), next_menu_id_(1) { menu_ = CreateMenu(node, start_child_index); @@ -152,11 +150,6 @@ int BookmarkMenuController::GetDropOperation( const BookmarkNode* drop_parent = node->GetParent(); int index_to_drop_at = drop_parent->IndexOfChild(node); if (*position == DROP_AFTER) { - if (node == profile_->GetBookmarkModel()->other_node()) { - // The other folder is shown after all bookmarks on the bookmark bar. - // Dropping after the other folder makes no sense. - *position = DROP_NONE; - } index_to_drop_at++; } else if (*position == DROP_ON) { drop_parent = node; @@ -217,9 +210,7 @@ void BookmarkMenuController::DropMenuClosed(MenuItemView* menu) { } bool BookmarkMenuController::CanDrag(MenuItemView* menu) { - const BookmarkNode* node = menu_id_to_node_map_[menu->GetCommand()]; - // Don't let users drag the other folder. - return node->GetParent() != profile_->GetBookmarkModel()->root_node(); + return true; } void BookmarkMenuController::WriteDragData(MenuItemView* sender, @@ -244,7 +235,7 @@ views::MenuItemView* BookmarkMenuController::GetSiblingMenu( views::MenuItemView::AnchorPosition* anchor, bool* has_mnemonics, views::MenuButton** button) { - if (show_other_folder_ || !bookmark_bar_ || for_drop_) + if (!bookmark_bar_ || for_drop_) return NULL; gfx::Point bookmark_bar_loc(screen_point); views::View::ConvertPointToView(NULL, bookmark_bar_, &bookmark_bar_loc); @@ -308,25 +299,10 @@ MenuItemView* BookmarkMenuController::CreateMenu(const BookmarkNode* parent, menu_id_to_node_map_[menu->GetCommand()] = parent; menu->set_has_icons(true); BuildMenu(parent, start_child_index, menu, &next_menu_id_); - if (show_other_folder_) - BuildOtherFolderMenu(menu, &next_menu_id_); node_to_menu_map_[parent] = menu; return menu; } -void BookmarkMenuController::BuildOtherFolderMenu( - MenuItemView* menu, int* next_menu_id) { - const BookmarkNode* other_folder = profile_->GetBookmarkModel()->other_node(); - int id = *next_menu_id; - (*next_menu_id)++; - SkBitmap* folder_icon = ResourceBundle::GetSharedInstance(). - GetBitmapNamed(IDR_BOOKMARK_BAR_FOLDER); - MenuItemView* submenu = menu->AppendSubMenuWithIcon( - id, l10n_util::GetString(IDS_BOOMARK_BAR_OTHER_BOOKMARKED), *folder_icon); - BuildMenu(other_folder, 0, submenu, next_menu_id); - menu_id_to_node_map_[id] = other_folder; -} - void BookmarkMenuController::BuildMenu(const BookmarkNode* parent, int start_child_index, MenuItemView* menu, diff --git a/chrome/browser/views/bookmark_menu_controller_views.h b/chrome/browser/views/bookmark_menu_controller_views.h index 150e6b0..511483a 100644 --- a/chrome/browser/views/bookmark_menu_controller_views.h +++ b/chrome/browser/views/bookmark_menu_controller_views.h @@ -52,8 +52,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver, PageNavigator* page_navigator, gfx::NativeWindow parent, const BookmarkNode* node, - int start_child_index, - bool show_other_folder); + int start_child_index); void RunMenuAt(BookmarkBarView* bookmark_bar, bool for_drop); @@ -129,10 +128,6 @@ class BookmarkMenuController : public BaseBookmarkModelObserver, views::MenuItemView* CreateMenu(const BookmarkNode* parent, int start_child_index); - // Builds the menu for the other bookmarks folder. This is added as the last - // item to menu_. - void BuildOtherFolderMenu(views::MenuItemView* menu, int* next_menu_id); - // Creates an entry in menu for each child node of |parent| starting at // |start_child_index|. void BuildMenu(const BookmarkNode* parent, @@ -184,9 +179,6 @@ class BookmarkMenuController : public BaseBookmarkModelObserver, // Is the menu being shown for a drop? bool for_drop_; - // Should the other folder be shown? - bool show_other_folder_; - // The bookmark bar. This is only non-null if we're showing a menu item // for a folder on the bookmark bar and not for drop. BookmarkBarView* bookmark_bar_; diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index ddc4768d..ea91539 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -6,7 +6,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "base/command_line.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_theme_provider.h" @@ -15,13 +14,11 @@ #include "chrome/browser/profile.h" #include "chrome/browser/upgrade_detector.h" #include "chrome/browser/view_ids.h" -#include "chrome/browser/views/bookmark_menu_button.h" #include "chrome/browser/views/browser_actions_container.h" #include "chrome/browser/views/event_utils.h" #include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/views/wrench_menu.h" #include "chrome/browser/wrench_menu_model.h" -#include "chrome/common/chrome_switches.h" #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "gfx/canvas.h" @@ -79,7 +76,6 @@ ToolbarView::ToolbarView(Browser* browser) browser_actions_(NULL), page_menu_(NULL), app_menu_(NULL), - bookmark_menu_(NULL), profile_(NULL), browser_(browser), profiles_menu_contents_(NULL), @@ -175,12 +171,6 @@ void ToolbarView::Init(Profile* profile) { l10n_util::GetString(IDS_PRODUCT_NAME))); app_menu_->SetID(VIEW_ID_APP_MENU); - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kBookmarkMenu)) { - bookmark_menu_ = new BookmarkMenuButton(browser_); - } else { - bookmark_menu_ = NULL; - } - // Catch the case where the window is created after we detect a new version. if (Singleton<UpgradeDetector>::get()->notify_upgrade()) ShowUpgradeReminder(); @@ -194,8 +184,6 @@ void ToolbarView::Init(Profile* profile) { AddChildView(reload_); AddChildView(location_bar_); AddChildView(browser_actions_); - if (bookmark_menu_) - AddChildView(bookmark_menu_); if (page_menu_) AddChildView(page_menu_); AddChildView(app_menu_); @@ -436,7 +424,6 @@ gfx::Size ToolbarView::GetPreferredSize() { reload_->GetPreferredSize().width() + kControlHorizOffset + browser_actions_->GetPreferredSize().width() + kMenuButtonOffset + - (bookmark_menu_ ? bookmark_menu_->GetPreferredSize().width() : 0) + (page_menu_ ? page_menu_->GetPreferredSize().width() : 0) + app_menu_->GetPreferredSize().width() + kPaddingRight; @@ -512,12 +499,9 @@ void ToolbarView::Layout() { int page_menu_width = page_menu_ ? page_menu_->GetPreferredSize().width() : 0; int app_menu_width = app_menu_->GetPreferredSize().width(); - int bookmark_menu_width = bookmark_menu_ ? - bookmark_menu_->GetPreferredSize().width() : 0; int location_x = reload_->x() + reload_->width() + kControlHorizOffset; - int available_width = width() - kPaddingRight - bookmark_menu_width - - app_menu_width - page_menu_width - browser_actions_width - - kMenuButtonOffset - location_x; + int available_width = width() - kPaddingRight - app_menu_width - + page_menu_width - browser_actions_width - kMenuButtonOffset - location_x; location_bar_->SetBounds(location_x, child_y, std::max(available_width, 0), child_height); @@ -535,12 +519,6 @@ void ToolbarView::Layout() { browser_actions_->Layout(); next_menu_x += browser_actions_width; - if (bookmark_menu_) { - bookmark_menu_->SetBounds(next_menu_x, child_y, bookmark_menu_width, - child_height); - next_menu_x += bookmark_menu_width; - } - if (page_menu_) { page_menu_->SetBounds(next_menu_x, child_y, page_menu_width, child_height); next_menu_x += page_menu_width; @@ -651,8 +629,6 @@ void ToolbarView::LoadImages() { base::i18n::IsRTL() ? IDR_MENU_PAGE_RTL : IDR_MENU_PAGE)); } app_menu_->SetIcon(GetAppMenuIcon()); - if (bookmark_menu_ != NULL) - bookmark_menu_->SetIcon(*tp->GetBitmapNamed(IDR_MENU_BOOKMARK)); } void ToolbarView::ShowUpgradeReminder() { diff --git a/chrome/browser/views/toolbar_view.h b/chrome/browser/views/toolbar_view.h index d31780b..064a08d 100644 --- a/chrome/browser/views/toolbar_view.h +++ b/chrome/browser/views/toolbar_view.h @@ -188,8 +188,6 @@ class ToolbarView : public AccessibleToolbarView, BrowserActionsContainer* browser_actions_; views::MenuButton* page_menu_; views::MenuButton* app_menu_; - // The bookmark menu button. This may be null. - views::MenuButton* bookmark_menu_; Profile* profile_; Browser* browser_; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 1f9b302..b60a16e 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -2386,8 +2386,6 @@ 'browser/views/bookmark_context_menu_controller_views.h', 'browser/views/bookmark_editor_view.cc', 'browser/views/bookmark_editor_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/browser_actions_container.cc', @@ -3094,8 +3092,6 @@ ['include', '^browser/views/bookmark_context_menu.h'], ['include', '^browser/views/bookmark_context_menu_controller_views.cc'], ['include', '^browser/views/bookmark_context_menu_controller_views.h'], - ['include', '^browser/views/bookmark_menu_button.cc'], - ['include', '^browser/views/bookmark_menu_button.h'], ['include', '^browser/views/bookmark_menu_controller_views.cc'], ['include', '^browser/views/browser_actions_container.cc'], ['include', '^browser/views/browser_actions_container.h'], diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 3b1625b..3e191f3 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -59,9 +59,6 @@ const char kAuthServerWhitelist[] = "auth-server-whitelist"; // automation-related messages on IPC channel with the given ID. const char kAutomationClientChannelID[] = "automation-channel"; -// Enables the bookmark menu. -const char kBookmarkMenu[] = "bookmark-menu"; - // Causes the browser process to throw an assertion on startup. const char kBrowserAssertTest[] = "assert-test"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index d07d2dd..2348d92 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -32,7 +32,6 @@ extern const char kAppsGalleryURL[]; extern const char kAppsNoThrob[]; extern const char kAuthServerWhitelist[]; extern const char kAutomationClientChannelID[]; -extern const char kBookmarkMenu[]; extern const char kBrowserAssertTest[]; extern const char kBrowserCrashTest[]; extern const char kBrowserSubprocessPath[]; diff --git a/chrome/test/data/profiles/complex_theme/Default/Extensions/mblmlcbknbnfebdfjnolmcapmdofhmme/1.1/Cached Theme.pak b/chrome/test/data/profiles/complex_theme/Default/Extensions/mblmlcbknbnfebdfjnolmcapmdofhmme/1.1/Cached Theme.pak Binary files differindex a47ccc0..f2dc700 100644 --- a/chrome/test/data/profiles/complex_theme/Default/Extensions/mblmlcbknbnfebdfjnolmcapmdofhmme/1.1/Cached Theme.pak +++ b/chrome/test/data/profiles/complex_theme/Default/Extensions/mblmlcbknbnfebdfjnolmcapmdofhmme/1.1/Cached Theme.pak |