OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/toolbar_view.h" | 5 #include "chrome/browser/ui/views/toolbar_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/i18n/number_formatting.h" | 9 #include "base/i18n/number_formatting.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
12 #include "chrome/browser/accessibility/browser_accessibility_state.h" | 12 #include "chrome/browser/accessibility/browser_accessibility_state.h" |
13 #include "chrome/browser/background_page_tracker.h" | 13 #include "chrome/browser/background_page_tracker.h" |
14 #include "chrome/browser/metrics/user_metrics.h" | 14 #include "chrome/browser/metrics/user_metrics.h" |
15 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
(...skipping 20 matching lines...) Expand all Loading... |
36 #include "views/widget/tooltip_manager.h" | 36 #include "views/widget/tooltip_manager.h" |
37 #include "views/window/non_client_view.h" | 37 #include "views/window/non_client_view.h" |
38 #include "views/window/window.h" | 38 #include "views/window/window.h" |
39 | 39 |
40 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
41 #include "chrome/browser/chromeos/cros/cros_library.h" | 41 #include "chrome/browser/chromeos/cros/cros_library.h" |
42 #include "chrome/browser/chromeos/cros/update_library.h" | 42 #include "chrome/browser/chromeos/cros/update_library.h" |
43 #include "chrome/browser/chromeos/dom_ui/wrench_menu_ui.h" | 43 #include "chrome/browser/chromeos/dom_ui/wrench_menu_ui.h" |
44 #include "views/controls/menu/menu_2.h" | 44 #include "views/controls/menu/menu_2.h" |
45 #endif | 45 #endif |
46 #include "chrome/browser/views/wrench_menu.h" | 46 #include "chrome/browser/ui/views/wrench_menu.h" |
47 | 47 |
48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
49 #include "chrome/browser/enumerate_modules_model_win.h" | 49 #include "chrome/browser/enumerate_modules_model_win.h" |
50 #endif | 50 #endif |
51 | 51 |
52 // The space between items is 4 px in general. | 52 // The space between items is 4 px in general. |
53 const int ToolbarView::kStandardSpacing = 4; | 53 const int ToolbarView::kStandardSpacing = 4; |
54 // The top of the toolbar has an edge we have to skip over in addition to the 4 | 54 // The top of the toolbar has an edge we have to skip over in addition to the 4 |
55 // px of spacing. | 55 // px of spacing. |
56 const int ToolbarView::kVertSpacing = kStandardSpacing + 1; | 56 const int ToolbarView::kVertSpacing = kStandardSpacing + 1; |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 #endif | 351 #endif |
352 wrench_menu_ = new WrenchMenu(browser_); | 352 wrench_menu_ = new WrenchMenu(browser_); |
353 wrench_menu_->Init(wrench_menu_model_.get()); | 353 wrench_menu_->Init(wrench_menu_model_.get()); |
354 | 354 |
355 for (size_t i = 0; i < menu_listeners_.size(); ++i) | 355 for (size_t i = 0; i < menu_listeners_.size(); ++i) |
356 menu_listeners_[i]->OnMenuOpened(); | 356 menu_listeners_[i]->OnMenuOpened(); |
357 | 357 |
358 wrench_menu_->RunMenu(app_menu_); | 358 wrench_menu_->RunMenu(app_menu_); |
359 | 359 |
360 #if defined(OS_CHROMEOS) | 360 #if defined(OS_CHROMEOS) |
361 cleanup: | 361 cleanup: |
362 #endif | 362 #endif |
363 if (destroyed_flag) | 363 if (destroyed_flag) |
364 return; | 364 return; |
365 destroyed_flag_ = NULL; | 365 destroyed_flag_ = NULL; |
366 | 366 |
367 // Stop showing the background app badge also. | 367 // Stop showing the background app badge also. |
368 BackgroundPageTracker::GetInstance()->AcknowledgeBackgroundPages(); | 368 BackgroundPageTracker::GetInstance()->AcknowledgeBackgroundPages(); |
369 } | 369 } |
370 | 370 |
371 //////////////////////////////////////////////////////////////////////////////// | 371 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 NOTREACHED(); | 771 NOTREACHED(); |
772 #endif | 772 #endif |
773 } else { | 773 } else { |
774 NOTREACHED(); | 774 NOTREACHED(); |
775 } | 775 } |
776 | 776 |
777 canvas->DrawBitmapInt(badge, icon.width() - badge.width(), kBadgeTopMargin); | 777 canvas->DrawBitmapInt(badge, icon.width() - badge.width(), kBadgeTopMargin); |
778 | 778 |
779 return canvas->ExtractBitmap(); | 779 return canvas->ExtractBitmap(); |
780 } | 780 } |
OLD | NEW |