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

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

Issue 25373009: Translate: New Bubble UX (for the view toolkit) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix: view id on tests Created 7 years, 1 month 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/toolbar_view.h" 5 #include "chrome/browser/ui/views/toolbar_view.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/i18n/number_formatting.h" 9 #include "base/i18n/number_formatting.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 14 matching lines...) Expand all
25 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 25 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
26 #include "chrome/browser/ui/omnibox/omnibox_view.h" 26 #include "chrome/browser/ui/omnibox/omnibox_view.h"
27 #include "chrome/browser/ui/tabs/tab_strip_model.h" 27 #include "chrome/browser/ui/tabs/tab_strip_model.h"
28 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" 28 #include "chrome/browser/ui/toolbar/wrench_menu_model.h"
29 #include "chrome/browser/ui/view_ids.h" 29 #include "chrome/browser/ui/view_ids.h"
30 #include "chrome/browser/ui/views/browser_actions_container.h" 30 #include "chrome/browser/ui/views/browser_actions_container.h"
31 #include "chrome/browser/ui/views/frame/browser_view.h" 31 #include "chrome/browser/ui/views/frame/browser_view.h"
32 #include "chrome/browser/ui/views/home_button.h" 32 #include "chrome/browser/ui/views/home_button.h"
33 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" 33 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h"
34 #include "chrome/browser/ui/views/location_bar/star_view.h" 34 #include "chrome/browser/ui/views/location_bar/star_view.h"
35 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h"
35 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h" 36 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h"
36 #include "chrome/browser/ui/views/wrench_menu.h" 37 #include "chrome/browser/ui/views/wrench_menu.h"
37 #include "chrome/browser/ui/views/wrench_toolbar_button.h" 38 #include "chrome/browser/ui/views/wrench_toolbar_button.h"
38 #include "chrome/browser/upgrade_detector.h" 39 #include "chrome/browser/upgrade_detector.h"
39 #include "chrome/common/chrome_switches.h" 40 #include "chrome/common/chrome_switches.h"
40 #include "chrome/common/pref_names.h" 41 #include "chrome/common/pref_names.h"
41 #include "content/public/browser/browser_accessibility_state.h" 42 #include "content/public/browser/browser_accessibility_state.h"
42 #include "content/public/browser/notification_service.h" 43 #include "content/public/browser/notification_service.h"
43 #include "content/public/browser/render_view_host.h" 44 #include "content/public/browser/render_view_host.h"
44 #include "content/public/browser/user_metrics.h" 45 #include "content/public/browser/user_metrics.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 menu_listeners_.RemoveObserver(listener); 283 menu_listeners_.RemoveObserver(listener);
283 } 284 }
284 285
285 views::View* ToolbarView::GetBookmarkBubbleAnchor() { 286 views::View* ToolbarView::GetBookmarkBubbleAnchor() {
286 views::View* star_view = location_bar()->star_view(); 287 views::View* star_view = location_bar()->star_view();
287 if (star_view && star_view->visible()) 288 if (star_view && star_view->visible())
288 return star_view; 289 return star_view;
289 return app_menu_; 290 return app_menu_;
290 } 291 }
291 292
293 views::View* ToolbarView::GetTranslateBubbleAnchor() {
294 views::View* translate_icon_view = location_bar()->translate_icon_view();
295 if (translate_icon_view)
296 return translate_icon_view;
297 return app_menu_;
298 }
299
292 views::MenuButton* ToolbarView::app_menu() const { 300 views::MenuButton* ToolbarView::app_menu() const {
293 return app_menu_; 301 return app_menu_;
294 } 302 }
295 303
296 //////////////////////////////////////////////////////////////////////////////// 304 ////////////////////////////////////////////////////////////////////////////////
297 // ToolbarView, AccessiblePaneView overrides: 305 // ToolbarView, AccessiblePaneView overrides:
298 306
299 bool ToolbarView::SetPaneFocus(views::View* initial_focus) { 307 bool ToolbarView::SetPaneFocus(views::View* initial_focus) {
300 if (!AccessiblePaneView::SetPaneFocus(initial_focus)) 308 if (!AccessiblePaneView::SetPaneFocus(initial_focus))
301 return false; 309 return false;
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 804
797 void ToolbarView::OnShowHomeButtonChanged() { 805 void ToolbarView::OnShowHomeButtonChanged() {
798 Layout(); 806 Layout();
799 SchedulePaint(); 807 SchedulePaint();
800 } 808 }
801 809
802 int ToolbarView::content_shadow_height() const { 810 int ToolbarView::content_shadow_height() const {
803 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ? 811 return browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH ?
804 kContentShadowHeightAsh : kContentShadowHeight; 812 kContentShadowHeightAsh : kContentShadowHeight;
805 } 813 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar_view.h ('k') | chrome/browser/ui/views/translate/translate_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698