Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Side by Side Diff: chrome/browser/ui/views/action_box_menu.cc

Issue 10857024: Attempt at fixing crash. Because BrowserActionView lazily creates its (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/browser_action_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/views/action_box_menu.h" 5 #include "chrome/browser/ui/views/action_box_menu.h"
6 6
7 #include "chrome/browser/ui/toolbar/action_box_menu_model.h" 7 #include "chrome/browser/ui/toolbar/action_box_menu_model.h"
8 #include "chrome/browser/ui/views/browser_action_view.h" 8 #include "chrome/browser/ui/views/browser_action_view.h"
9 #include "grit/generated_resources.h" 9 #include "grit/generated_resources.h"
10 #include "grit/theme_resources.h" 10 #include "grit/theme_resources.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // Ignore the result since we don't need to handle a deleted menu specially. 50 // Ignore the result since we don't need to handle a deleted menu specially.
51 ignore_result( 51 ignore_result(
52 menu_runner_->RunMenuAt(menu_button->GetWidget(), 52 menu_runner_->RunMenuAt(menu_button->GetWidget(),
53 menu_button, 53 menu_button,
54 gfx::Rect(screen_location, menu_button->size()), 54 gfx::Rect(screen_location, menu_button->size()),
55 views::MenuItemView::TOPRIGHT, 55 views::MenuItemView::TOPRIGHT,
56 views::MenuRunner::HAS_MNEMONICS)); 56 views::MenuRunner::HAS_MNEMONICS));
57 } 57 }
58 58
59 void ActionBoxMenu::ExecuteCommand(int id) { 59 void ActionBoxMenu::ExecuteCommand(int id) {
60 }; 60 }
61 61
62 views::Border* ActionBoxMenu::CreateMenuBorder() { 62 views::Border* ActionBoxMenu::CreateMenuBorder() {
63 // TODO(yefim): Use correct theme color on non-Windows. 63 // TODO(yefim): Use correct theme color on non-Windows.
64 SkColor border_color = SK_ColorBLACK; 64 SkColor border_color = SK_ColorBLACK;
65 #if defined(OS_WIN) && !defined(USE_AURA) 65 #if defined(OS_WIN) && !defined(USE_AURA)
66 // TODO(yefim): Move to Windows only files if possible. 66 // TODO(yefim): Move to Windows only files if possible.
67 border_color = ui::NativeThemeWin::instance()->GetThemeColorWithDefault( 67 border_color = ui::NativeThemeWin::instance()->GetThemeColorWithDefault(
68 ui::NativeThemeWin::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR, 68 ui::NativeThemeWin::MENU, MENU_POPUPITEM, MPI_NORMAL, TMT_TEXTCOLOR,
69 COLOR_MENUTEXT); 69 COLOR_MENUTEXT);
70 #endif 70 #endif
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 string16 label = l10n_util::GetStringUTF16(starred_ ? 154 string16 label = l10n_util::GetStringUTF16(starred_ ?
155 IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR); 155 IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR);
156 gfx::ImageSkia* icon = 156 gfx::ImageSkia* icon =
157 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( 157 ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
158 starred_ ? IDR_STAR_LIT : IDR_STAR); 158 starred_ ? IDR_STAR_LIT : IDR_STAR);
159 views::MenuItemView* item = 159 views::MenuItemView* item =
160 parent->AppendMenuItemWithIcon(*item_id, label, *icon); 160 parent->AppendMenuItemWithIcon(*item_id, label, *icon);
161 (*item_id)++; 161 (*item_id)++;
162 return item; 162 return item;
163 } 163 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/browser_action_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698