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

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

Issue 1396923003: Autofill: Replace "save credit card" infobar with a bubble (Views only). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: defined(TOOLKIT_VIEWS) -> defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX). Created 5 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
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_view.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/toolbar_view.h" 5 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/number_formatting.h" 10 #include "base/i18n/number_formatting.h"
(...skipping 15 matching lines...) Expand all
26 #include "chrome/browser/ui/browser_window.h" 26 #include "chrome/browser/ui/browser_window.h"
27 #include "chrome/browser/ui/global_error/global_error_service.h" 27 #include "chrome/browser/ui/global_error/global_error_service.h"
28 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 28 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
29 #include "chrome/browser/ui/tabs/tab_strip_model.h" 29 #include "chrome/browser/ui/tabs/tab_strip_model.h"
30 #include "chrome/browser/ui/view_ids.h" 30 #include "chrome/browser/ui/view_ids.h"
31 #include "chrome/browser/ui/views/extensions/extension_popup.h" 31 #include "chrome/browser/ui/views/extensions/extension_popup.h"
32 #include "chrome/browser/ui/views/frame/browser_view.h" 32 #include "chrome/browser/ui/views/frame/browser_view.h"
33 #include "chrome/browser/ui/views/layout_constants.h" 33 #include "chrome/browser/ui/views/layout_constants.h"
34 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h" 34 #include "chrome/browser/ui/views/location_bar/page_action_image_view.h"
35 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" 35 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h"
36 #include "chrome/browser/ui/views/location_bar/save_credit_card_icon_view.h"
36 #include "chrome/browser/ui/views/location_bar/star_view.h" 37 #include "chrome/browser/ui/views/location_bar/star_view.h"
37 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h" 38 #include "chrome/browser/ui/views/location_bar/translate_icon_view.h"
38 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h" 39 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h"
39 #include "chrome/browser/ui/views/toolbar/app_menu_button.h" 40 #include "chrome/browser/ui/views/toolbar/app_menu_button.h"
40 #include "chrome/browser/ui/views/toolbar/back_button.h" 41 #include "chrome/browser/ui/views/toolbar/back_button.h"
41 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" 42 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h"
42 #include "chrome/browser/ui/views/toolbar/home_button.h" 43 #include "chrome/browser/ui/views/toolbar/home_button.h"
43 #include "chrome/browser/ui/views/toolbar/reload_button.h" 44 #include "chrome/browser/ui/views/toolbar/reload_button.h"
44 #include "chrome/browser/ui/views/toolbar/toolbar_button.h" 45 #include "chrome/browser/ui/views/toolbar/toolbar_button.h"
45 #include "chrome/common/chrome_switches.h" 46 #include "chrome/common/chrome_switches.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 302
302 bool ToolbarView::IsAppMenuFocused() { 303 bool ToolbarView::IsAppMenuFocused() {
303 return app_menu_button_->HasFocus(); 304 return app_menu_button_->HasFocus();
304 } 305 }
305 306
306 views::View* ToolbarView::GetBookmarkBubbleAnchor() { 307 views::View* ToolbarView::GetBookmarkBubbleAnchor() {
307 views::View* star_view = location_bar()->star_view(); 308 views::View* star_view = location_bar()->star_view();
308 return (star_view && star_view->visible()) ? star_view : app_menu_button_; 309 return (star_view && star_view->visible()) ? star_view : app_menu_button_;
309 } 310 }
310 311
312 views::View* ToolbarView::GetSaveCreditCardBubbleAnchor() {
313 views::View* save_credit_card_icon_view =
314 location_bar()->save_credit_card_icon_view();
315 return (save_credit_card_icon_view && save_credit_card_icon_view->visible())
316 ? save_credit_card_icon_view
317 : app_menu_button_;
318 }
319
311 views::View* ToolbarView::GetTranslateBubbleAnchor() { 320 views::View* ToolbarView::GetTranslateBubbleAnchor() {
312 views::View* translate_icon_view = location_bar()->translate_icon_view(); 321 views::View* translate_icon_view = location_bar()->translate_icon_view();
313 return (translate_icon_view && translate_icon_view->visible()) 322 return (translate_icon_view && translate_icon_view->visible())
314 ? translate_icon_view 323 ? translate_icon_view
315 : app_menu_button_; 324 : app_menu_button_;
316 } 325 }
317 326
318 void ToolbarView::ExecuteExtensionCommand( 327 void ToolbarView::ExecuteExtensionCommand(
319 const extensions::Extension* extension, 328 const extensions::Extension* extension,
320 const extensions::Command& command) { 329 const extensions::Command& command) {
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 void ToolbarView::OnShowHomeButtonChanged() { 838 void ToolbarView::OnShowHomeButtonChanged() {
830 Layout(); 839 Layout();
831 SchedulePaint(); 840 SchedulePaint();
832 } 841 }
833 842
834 int ToolbarView::content_shadow_height() const { 843 int ToolbarView::content_shadow_height() const {
835 return GetLayoutConstant( 844 return GetLayoutConstant(
836 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ? 845 (browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) ?
837 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT); 846 TOOLBAR_CONTENT_SHADOW_HEIGHT_ASH : TOOLBAR_CONTENT_SHADOW_HEIGHT);
838 } 847 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/toolbar/toolbar_view.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698