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

Side by Side Diff: chrome/browser/ui/browser_commands.cc

Issue 1016003002: Show the password bubble even if the browser window has no focus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed the comments from sky@ Created 5 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/passwords/manage_passwords_bubble_view.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"
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 if (chrome_translate_client->GetLanguageState().translation_pending()) 804 if (chrome_translate_client->GetLanguageState().translation_pending())
805 step = translate::TRANSLATE_STEP_TRANSLATING; 805 step = translate::TRANSLATE_STEP_TRANSLATING;
806 else if (chrome_translate_client->GetLanguageState().IsPageTranslated()) 806 else if (chrome_translate_client->GetLanguageState().IsPageTranslated())
807 step = translate::TRANSLATE_STEP_AFTER_TRANSLATE; 807 step = translate::TRANSLATE_STEP_AFTER_TRANSLATE;
808 } 808 }
809 browser->window()->ShowTranslateBubble( 809 browser->window()->ShowTranslateBubble(
810 web_contents, step, translate::TranslateErrors::NONE, true); 810 web_contents, step, translate::TranslateErrors::NONE, true);
811 } 811 }
812 812
813 void ManagePasswordsForPage(Browser* browser) { 813 void ManagePasswordsForPage(Browser* browser) {
814 if (!browser->window()->IsActive())
815 return;
816
817 WebContents* web_contents = 814 WebContents* web_contents =
818 browser->tab_strip_model()->GetActiveWebContents(); 815 browser->tab_strip_model()->GetActiveWebContents();
819 ManagePasswordsUIController* controller = 816 ManagePasswordsUIController* controller =
820 ManagePasswordsUIController::FromWebContents(web_contents); 817 ManagePasswordsUIController::FromWebContents(web_contents);
821 TabDialogs::FromWebContents(web_contents)->ShowManagePasswordsBubble( 818 TabDialogs::FromWebContents(web_contents)->ShowManagePasswordsBubble(
822 !controller->IsAutomaticallyOpeningBubble()); 819 !controller->IsAutomaticallyOpeningBubble());
823 } 820 }
824 821
825 #if defined(OS_WIN) 822 #if defined(OS_WIN)
826 void TogglePagePinnedToStartScreen(Browser* browser) { 823 void TogglePagePinnedToStartScreen(Browser* browser) {
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 browser->host_desktop_type())); 1274 browser->host_desktop_type()));
1278 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1275 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1279 1276
1280 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1277 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1281 contents->GetRenderViewHost()->SyncRendererPrefs(); 1278 contents->GetRenderViewHost()->SyncRendererPrefs();
1282 app_browser->window()->Show(); 1279 app_browser->window()->Show();
1283 } 1280 }
1284 #endif // defined(ENABLE_EXTENSIONS) 1281 #endif // defined(ENABLE_EXTENSIONS)
1285 1282
1286 } // namespace chrome 1283 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698