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

Side by Side Diff: chrome/browser/ui/browser_commands.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/browser_commands.h ('k') | chrome/browser/ui/browser_window.h » ('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 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/browser_commands.h" 5 #include "chrome/browser/ui/browser_commands.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/app/chrome_command_ids.h" 11 #include "chrome/app/chrome_command_ids.h"
12 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 12 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/browsing_data/browsing_data_helper.h" 14 #include "chrome/browser/browsing_data/browsing_data_helper.h"
15 #include "chrome/browser/browsing_data/browsing_data_remover.h" 15 #include "chrome/browser/browsing_data/browsing_data_remover.h"
16 #include "chrome/browser/chrome_notification_types.h" 16 #include "chrome/browser/chrome_notification_types.h"
17 #include "chrome/browser/devtools/devtools_window.h" 17 #include "chrome/browser/devtools/devtools_window.h"
18 #include "chrome/browser/dom_distiller/tab_utils.h" 18 #include "chrome/browser/dom_distiller/tab_utils.h"
19 #include "chrome/browser/lifetime/application_lifetime.h" 19 #include "chrome/browser/lifetime/application_lifetime.h"
20 #include "chrome/browser/media/router/media_router_dialog_controller.h" 20 #include "chrome/browser/media/router/media_router_dialog_controller.h"
21 #include "chrome/browser/platform_util.h" 21 #include "chrome/browser/platform_util.h"
22 #include "chrome/browser/prefs/incognito_mode_prefs.h" 22 #include "chrome/browser/prefs/incognito_mode_prefs.h"
23 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/search/search.h" 24 #include "chrome/browser/search/search.h"
25 #include "chrome/browser/sessions/session_service_factory.h" 25 #include "chrome/browser/sessions/session_service_factory.h"
26 #include "chrome/browser/sessions/tab_restore_service_factory.h" 26 #include "chrome/browser/sessions/tab_restore_service_factory.h"
27 #include "chrome/browser/translate/chrome_translate_client.h" 27 #include "chrome/browser/translate/chrome_translate_client.h"
28 #include "chrome/browser/ui/accelerator_utils.h" 28 #include "chrome/browser/ui/accelerator_utils.h"
29 #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h"
29 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" 30 #include "chrome/browser/ui/bookmarks/bookmark_utils.h"
30 #include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h" 31 #include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h"
31 #include "chrome/browser/ui/browser.h" 32 #include "chrome/browser/ui/browser.h"
32 #include "chrome/browser/ui/browser_command_controller.h" 33 #include "chrome/browser/ui/browser_command_controller.h"
33 #include "chrome/browser/ui/browser_dialogs.h" 34 #include "chrome/browser/ui/browser_dialogs.h"
34 #include "chrome/browser/ui/browser_instant_controller.h" 35 #include "chrome/browser/ui/browser_instant_controller.h"
35 #include "chrome/browser/ui/browser_live_tab_context.h" 36 #include "chrome/browser/ui/browser_live_tab_context.h"
36 #include "chrome/browser/ui/browser_navigator_params.h" 37 #include "chrome/browser/ui/browser_navigator_params.h"
37 #include "chrome/browser/ui/browser_tabstrip.h" 38 #include "chrome/browser/ui/browser_tabstrip.h"
38 #include "chrome/browser/ui/browser_window.h" 39 #include "chrome/browser/ui/browser_window.h"
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 content::RecordAction(UserMetricsAction("BookmarkAllTabs")); 799 content::RecordAction(UserMetricsAction("BookmarkAllTabs"));
799 chrome::ShowBookmarkAllTabsDialog(browser); 800 chrome::ShowBookmarkAllTabsDialog(browser);
800 } 801 }
801 802
802 bool CanBookmarkAllTabs(const Browser* browser) { 803 bool CanBookmarkAllTabs(const Browser* browser) {
803 return browser->tab_strip_model()->count() > 1 && 804 return browser->tab_strip_model()->count() > 1 &&
804 !chrome::ShouldRemoveBookmarkOpenPagesUI(browser->profile()) && 805 !chrome::ShouldRemoveBookmarkOpenPagesUI(browser->profile()) &&
805 CanBookmarkCurrentPageInternal(browser, false); 806 CanBookmarkCurrentPageInternal(browser, false);
806 } 807 }
807 808
809 #if defined(TOOLKIT_VIEWS) && !defined(OS_MACOSX)
810 void SaveCreditCard(Browser* browser) {
811 WebContents* web_contents =
812 browser->tab_strip_model()->GetActiveWebContents();
813 autofill::SaveCardBubbleControllerImpl* controller =
814 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents);
815 DCHECK(controller);
816 controller->ShowBubble();
817 }
818 #endif
819
808 void Translate(Browser* browser) { 820 void Translate(Browser* browser) {
809 if (!browser->window()->IsActive()) 821 if (!browser->window()->IsActive())
810 return; 822 return;
811 823
812 WebContents* web_contents = 824 WebContents* web_contents =
813 browser->tab_strip_model()->GetActiveWebContents(); 825 browser->tab_strip_model()->GetActiveWebContents();
814 ChromeTranslateClient* chrome_translate_client = 826 ChromeTranslateClient* chrome_translate_client =
815 ChromeTranslateClient::FromWebContents(web_contents); 827 ChromeTranslateClient::FromWebContents(web_contents);
816 828
817 translate::TranslateStep step = translate::TRANSLATE_STEP_BEFORE_TRANSLATE; 829 translate::TranslateStep step = translate::TRANSLATE_STEP_BEFORE_TRANSLATE;
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 browser->host_desktop_type())); 1323 browser->host_desktop_type()));
1312 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1324 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1313 1325
1314 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1326 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1315 contents->GetRenderViewHost()->SyncRendererPrefs(); 1327 contents->GetRenderViewHost()->SyncRendererPrefs();
1316 app_browser->window()->Show(); 1328 app_browser->window()->Show();
1317 } 1329 }
1318 #endif // defined(ENABLE_EXTENSIONS) 1330 #endif // defined(ENABLE_EXTENSIONS)
1319 1331
1320 } // namespace chrome 1332 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_commands.h ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698