| 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/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 } | 1521 } |
| 1522 | 1522 |
| 1523 void LocationBarView::RefreshTranslateIcon() { | 1523 void LocationBarView::RefreshTranslateIcon() { |
| 1524 if (!TranslateManager::IsTranslateBubbleEnabled()) | 1524 if (!TranslateManager::IsTranslateBubbleEnabled()) |
| 1525 return; | 1525 return; |
| 1526 | 1526 |
| 1527 WebContents* web_contents = GetWebContents(); | 1527 WebContents* web_contents = GetWebContents(); |
| 1528 if (!web_contents) | 1528 if (!web_contents) |
| 1529 return; | 1529 return; |
| 1530 LanguageState& language_state = TranslateTabHelper::FromWebContents( | 1530 LanguageState& language_state = TranslateTabHelper::FromWebContents( |
| 1531 web_contents)->language_state(); | 1531 web_contents)->GetLanguageState(); |
| 1532 bool enabled = language_state.translate_enabled(); | 1532 bool enabled = language_state.translate_enabled(); |
| 1533 command_updater()->UpdateCommandEnabled(IDC_TRANSLATE_PAGE, enabled); | 1533 command_updater()->UpdateCommandEnabled(IDC_TRANSLATE_PAGE, enabled); |
| 1534 translate_icon_view_->SetVisible(enabled); | 1534 translate_icon_view_->SetVisible(enabled); |
| 1535 translate_icon_view_->SetToggled(language_state.IsPageTranslated()); | 1535 translate_icon_view_->SetToggled(language_state.IsPageTranslated()); |
| 1536 } | 1536 } |
| 1537 | 1537 |
| 1538 void LocationBarView::ShowManagePasswordsBubbleIfNeeded() { | 1538 void LocationBarView::ShowManagePasswordsBubbleIfNeeded() { |
| 1539 DCHECK(manage_passwords_icon_view_); | 1539 DCHECK(manage_passwords_icon_view_); |
| 1540 WebContents* web_contents = GetWebContents(); | 1540 WebContents* web_contents = GetWebContents(); |
| 1541 if (!web_contents) | 1541 if (!web_contents) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1589 bounds.Inset(-(horizontal_padding + 1) / 2, 0); | 1589 bounds.Inset(-(horizontal_padding + 1) / 2, 0); |
| 1590 location_bar_util::PaintExtensionActionBackground( | 1590 location_bar_util::PaintExtensionActionBackground( |
| 1591 *(*page_action_view)->image_view()->page_action(), | 1591 *(*page_action_view)->image_view()->page_action(), |
| 1592 tab_id, canvas, bounds, text_color, background_color); | 1592 tab_id, canvas, bounds, text_color, background_color); |
| 1593 } | 1593 } |
| 1594 } | 1594 } |
| 1595 | 1595 |
| 1596 void LocationBarView::AccessibilitySetValue(const base::string16& new_value) { | 1596 void LocationBarView::AccessibilitySetValue(const base::string16& new_value) { |
| 1597 omnibox_view_->SetUserText(new_value, new_value, true); | 1597 omnibox_view_->SetUserText(new_value, new_value, true); |
| 1598 } | 1598 } |
| OLD | NEW |