| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |