OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/views/bookmark_bar_view.h" | 5 #include "chrome/browser/views/bookmark_bar_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1381 | 1381 |
1382 void BookmarkBarView::StartShowFolderDropMenuTimer(const BookmarkNode* node) { | 1382 void BookmarkBarView::StartShowFolderDropMenuTimer(const BookmarkNode* node) { |
1383 if (testing_) { | 1383 if (testing_) { |
1384 // So that tests can run as fast as possible disable the delay during | 1384 // So that tests can run as fast as possible disable the delay during |
1385 // testing. | 1385 // testing. |
1386 ShowDropFolderForNode(node); | 1386 ShowDropFolderForNode(node); |
1387 return; | 1387 return; |
1388 } | 1388 } |
1389 DCHECK(!show_folder_drop_menu_task_); | 1389 DCHECK(!show_folder_drop_menu_task_); |
1390 show_folder_drop_menu_task_ = new ShowFolderDropMenuTask(this, node); | 1390 show_folder_drop_menu_task_ = new ShowFolderDropMenuTask(this, node); |
1391 #if defined(OS_WIN) | 1391 int delay = View::GetMenuShowDelay(); |
1392 static DWORD delay = 0; | |
1393 if (!delay && !SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &delay, 0)) | |
1394 delay = kShowFolderDropMenuDelay; | |
1395 #else | |
1396 int delay = kShowFolderDropMenuDelay; | |
1397 #endif | |
1398 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 1392 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
1399 show_folder_drop_menu_task_, delay); | 1393 show_folder_drop_menu_task_, delay); |
1400 } | 1394 } |
1401 | 1395 |
1402 int BookmarkBarView::CalculateDropOperation(const DropTargetEvent& event, | 1396 int BookmarkBarView::CalculateDropOperation(const DropTargetEvent& event, |
1403 const BookmarkDragData& data, | 1397 const BookmarkDragData& data, |
1404 int* index, | 1398 int* index, |
1405 bool* drop_on, | 1399 bool* drop_on, |
1406 bool* is_over_overflow, | 1400 bool* is_over_overflow, |
1407 bool* is_over_other) { | 1401 bool* is_over_other) { |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1724 // The tooltip is the only way we have to display text explaining the error | 1718 // The tooltip is the only way we have to display text explaining the error |
1725 // to the user. | 1719 // to the user. |
1726 sync_error_button->SetTooltipText( | 1720 sync_error_button->SetTooltipText( |
1727 l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); | 1721 l10n_util::GetString(IDS_SYNC_BOOKMARK_BAR_ERROR_DESC)); |
1728 sync_error_button->SetAccessibleName( | 1722 sync_error_button->SetAccessibleName( |
1729 l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); | 1723 l10n_util::GetString(IDS_ACCNAME_SYNC_ERROR_BUTTON)); |
1730 sync_error_button->SetIcon( | 1724 sync_error_button->SetIcon( |
1731 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); | 1725 *ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_WARNING)); |
1732 return sync_error_button; | 1726 return sync_error_button; |
1733 } | 1727 } |
OLD | NEW |