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

Side by Side Diff: chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.cc

Issue 1473543002: Implement newly designed sign-in related histograms for desktop platorms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: format Created 5 years 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/signin/signin_promo.cc ('k') | chrome/browser/ui/browser_command_controller.cc » ('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/bookmarks/bookmark_bubble_sign_in_delegate.h" 5 #include "chrome/browser/ui/bookmarks/bookmark_bubble_sign_in_delegate.h"
6 6
7 #include "chrome/browser/signin/signin_promo.h" 7 #include "chrome/browser/signin/signin_promo.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_finder.h" 9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_list.h" 10 #include "chrome/browser/ui/browser_list.h"
11 #include "chrome/browser/ui/browser_window.h" 11 #include "chrome/browser/ui/browser_window.h"
12 #include "chrome/browser/ui/chrome_pages.h" 12 #include "chrome/browser/ui/chrome_pages.h"
13 #include "chrome/browser/ui/tabs/tab_strip_model.h" 13 #include "chrome/browser/ui/tabs/tab_strip_model.h"
14 14
15 BookmarkBubbleSignInDelegate::BookmarkBubbleSignInDelegate(Browser* browser) 15 BookmarkBubbleSignInDelegate::BookmarkBubbleSignInDelegate(Browser* browser)
16 : browser_(browser), 16 : browser_(browser),
17 profile_(browser->profile()), 17 profile_(browser->profile()),
18 desktop_type_(browser->host_desktop_type()) { 18 desktop_type_(browser->host_desktop_type()) {
19 BrowserList::AddObserver(this); 19 BrowserList::AddObserver(this);
20 } 20 }
21 21
22 BookmarkBubbleSignInDelegate::~BookmarkBubbleSignInDelegate() { 22 BookmarkBubbleSignInDelegate::~BookmarkBubbleSignInDelegate() {
23 BrowserList::RemoveObserver(this); 23 BrowserList::RemoveObserver(this);
24 } 24 }
25 25
26 void BookmarkBubbleSignInDelegate::OnSignInLinkClicked() { 26 void BookmarkBubbleSignInDelegate::OnSignInLinkClicked() {
27 EnsureBrowser(); 27 EnsureBrowser();
28 chrome::ShowBrowserSignin(browser_, signin_metrics::SOURCE_BOOKMARK_BUBBLE); 28 chrome::ShowBrowserSignin(
29 browser_, signin_metrics::AccessPoint::ACCESS_POINT_BOOKMARK_BUBBLE);
29 } 30 }
30 31
31 void BookmarkBubbleSignInDelegate::OnBrowserRemoved(Browser* browser) { 32 void BookmarkBubbleSignInDelegate::OnBrowserRemoved(Browser* browser) {
32 if (browser == browser_) 33 if (browser == browser_)
33 browser_ = NULL; 34 browser_ = NULL;
34 } 35 }
35 36
36 void BookmarkBubbleSignInDelegate::EnsureBrowser() { 37 void BookmarkBubbleSignInDelegate::EnsureBrowser() {
37 if (!browser_) { 38 if (!browser_) {
38 Profile* original_profile = profile_->GetOriginalProfile(); 39 Profile* original_profile = profile_->GetOriginalProfile();
39 browser_ = chrome::FindLastActiveWithProfile(original_profile, 40 browser_ = chrome::FindLastActiveWithProfile(original_profile,
40 desktop_type_); 41 desktop_type_);
41 if (!browser_) { 42 if (!browser_) {
42 browser_ = new Browser(Browser::CreateParams(original_profile, 43 browser_ = new Browser(Browser::CreateParams(original_profile,
43 desktop_type_)); 44 desktop_type_));
44 } 45 }
45 } 46 }
46 } 47 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_promo.cc ('k') | chrome/browser/ui/browser_command_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698