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

Side by Side Diff: chrome/browser/ui/autofill/save_card_bubble_controller_impl.cc

Issue 2887183005: Don't update the save card bubble icon once the browser isn't available. (Closed)
Patch Set: Created 3 years, 7 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/autofill/save_card_bubble_controller_impl.h" 5 #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "chrome/browser/ui/autofill/save_card_bubble_view.h" 9 #include "chrome/browser/ui/autofill/save_card_bubble_view.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 timer_.reset(new base::ElapsedTimer()); 292 timer_.reset(new base::ElapsedTimer());
293 293
294 AutofillMetrics::LogSaveCardPromptMetric( 294 AutofillMetrics::LogSaveCardPromptMetric(
295 AutofillMetrics::SAVE_CARD_PROMPT_SHOWN, is_uploading_, is_reshow_, 295 AutofillMetrics::SAVE_CARD_PROMPT_SHOWN, is_uploading_, is_reshow_,
296 pref_service_->GetInteger( 296 pref_service_->GetInteger(
297 prefs::kAutofillAcceptSaveCreditCardPromptState)); 297 prefs::kAutofillAcceptSaveCreditCardPromptState));
298 } 298 }
299 299
300 void SaveCardBubbleControllerImpl::UpdateIcon() { 300 void SaveCardBubbleControllerImpl::UpdateIcon() {
301 Browser* browser = chrome::FindBrowserWithWebContents(web_contents()); 301 Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
302 if (!browser)
303 return;
302 LocationBar* location_bar = browser->window()->GetLocationBar(); 304 LocationBar* location_bar = browser->window()->GetLocationBar();
303 location_bar->UpdateSaveCreditCardIcon(); 305 location_bar->UpdateSaveCreditCardIcon();
304 } 306 }
305 307
306 void SaveCardBubbleControllerImpl::OpenUrl(const GURL& url) { 308 void SaveCardBubbleControllerImpl::OpenUrl(const GURL& url) {
307 web_contents()->OpenURL(content::OpenURLParams( 309 web_contents()->OpenURL(content::OpenURLParams(
308 url, content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB, 310 url, content::Referrer(), WindowOpenDisposition::NEW_FOREGROUND_TAB,
309 ui::PAGE_TRANSITION_LINK, false)); 311 ui::PAGE_TRANSITION_LINK, false));
310 } 312 }
311 313
312 } // namespace autofill 314 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698