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

Side by Side Diff: chrome/browser/ui/toolbar/action_box_menu_model.cc

Issue 10945010: Switch BookmarkTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 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 | « chrome/browser/ui/tab_contents/tab_contents.cc ('k') | no next file » | 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/toolbar/action_box_menu_model.h" 5 #include "chrome/browser/ui/toolbar/action_box_menu_model.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/chrome_to_mobile_service.h" 9 #include "chrome/browser/chrome_to_mobile_service.h"
10 #include "chrome/browser/chrome_to_mobile_service_factory.h" 10 #include "chrome/browser/chrome_to_mobile_service_factory.h"
(...skipping 30 matching lines...) Expand all
41 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 41 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
42 if (!browser_->profile()->IsOffTheRecord() && 42 if (!browser_->profile()->IsOffTheRecord() &&
43 ChromeToMobileServiceFactory::GetForProfile(browser_->profile())-> 43 ChromeToMobileServiceFactory::GetForProfile(browser_->profile())->
44 HasMobiles()) { 44 HasMobiles()) {
45 AddItemWithStringId(IDC_CHROME_TO_MOBILE_PAGE, 45 AddItemWithStringId(IDC_CHROME_TO_MOBILE_PAGE,
46 IDS_CHROME_TO_MOBILE_BUBBLE_TOOLTIP); 46 IDS_CHROME_TO_MOBILE_BUBBLE_TOOLTIP);
47 SetIcon(GetIndexOfCommandId(IDC_CHROME_TO_MOBILE_PAGE), 47 SetIcon(GetIndexOfCommandId(IDC_CHROME_TO_MOBILE_PAGE),
48 rb.GetNativeImageNamed(IDR_MOBILE)); 48 rb.GetNativeImageNamed(IDR_MOBILE));
49 } 49 }
50 50
51 TabContents* current_tab_contents = chrome::GetActiveTabContents(browser_); 51 content::WebContents* current_web_contents =
52 bool starred = current_tab_contents->bookmark_tab_helper()->is_starred(); 52 chrome::GetActiveWebContents(browser_);
53 BookmarkTabHelper* bookmark_tab_helper =
54 BookmarkTabHelper::FromWebContents(current_web_contents);
55 bool starred = bookmark_tab_helper->is_starred();
53 AddItemWithStringId(IDC_BOOKMARK_PAGE, 56 AddItemWithStringId(IDC_BOOKMARK_PAGE,
54 starred ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR); 57 starred ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR);
55 SetIcon(GetIndexOfCommandId(IDC_BOOKMARK_PAGE), 58 SetIcon(GetIndexOfCommandId(IDC_BOOKMARK_PAGE),
56 rb.GetNativeImageNamed(starred ? IDR_STAR_LIT : IDR_STAR)); 59 rb.GetNativeImageNamed(starred ? IDR_STAR_LIT : IDR_STAR));
57 60
58 AddItemWithStringId(IDC_SHARE_PAGE, IDS_SHARE_PAGE); 61 AddItemWithStringId(IDC_SHARE_PAGE, IDS_SHARE_PAGE);
59 SetIcon(GetIndexOfCommandId(IDC_SHARE_PAGE), 62 SetIcon(GetIndexOfCommandId(IDC_SHARE_PAGE),
60 rb.GetNativeImageNamed(IDR_SHARE)); 63 rb.GetNativeImageNamed(IDR_SHARE));
61 64
62 // Adds extensions to the model. 65 // Adds extensions to the model.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 ExtensionService* extension_service = 123 ExtensionService* extension_service =
121 extensions::ExtensionSystem::Get(browser_->profile())-> 124 extensions::ExtensionSystem::Get(browser_->profile())->
122 extension_service(); 125 extension_service();
123 return extension_service->toolbar_model()->action_box_menu_items(); 126 return extension_service->toolbar_model()->action_box_menu_items();
124 } 127 }
125 128
126 void ActionBoxMenuModel::Observe(int type, 129 void ActionBoxMenuModel::Observe(int type,
127 const content::NotificationSource& source, 130 const content::NotificationSource& source,
128 const content::NotificationDetails& details) { 131 const content::NotificationDetails& details) {
129 } 132 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698