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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 133273029: Move LanguageState to the translate component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comment + rebase Created 6 years, 11 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
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/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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.cc ('k') | chrome/browser/ui/views/translate/translate_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698