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

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

Issue 2793443003: Removed NOTIFICATION_BROWSER_CLOSING notification (Closed)
Patch Set: Added browser tests Created 3 years, 8 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
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_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 TabStripModel* tab_strip = browser->tab_strip_model(); 749 TabStripModel* tab_strip = browser->tab_strip_model();
750 WebContents* contents = 750 WebContents* contents =
751 tab_strip->DetachWebContentsAt(tab_strip->active_index()); 751 tab_strip->DetachWebContentsAt(tab_strip->active_index());
752 Browser* b = new Browser(Browser::CreateParams(browser->profile(), true)); 752 Browser* b = new Browser(Browser::CreateParams(browser->profile(), true));
753 b->tab_strip_model()->AppendWebContents(contents, true); 753 b->tab_strip_model()->AppendWebContents(contents, true);
754 b->window()->Show(); 754 b->window()->Show();
755 } 755 }
756 756
757 void Exit() { 757 void Exit() {
758 content::RecordAction(UserMetricsAction("Exit")); 758 content::RecordAction(UserMetricsAction("Exit"));
759 chrome::AttemptUserExit(); 759 chrome::AttemptExit();
sky 2017/03/31 14:23:41 Why is this change necessary?
Alexey Seren 2017/04/02 12:02:35 This is fix of shutdown histograms on windows when
hashimoto 2017/04/04 08:54:07 This change looks wrong as the comments in applica
sky 2017/04/04 16:56:49 Agreed. The conditional you point at was added her
760 } 760 }
761 761
762 void BookmarkCurrentPageIgnoringExtensionOverrides(Browser* browser) { 762 void BookmarkCurrentPageIgnoringExtensionOverrides(Browser* browser) {
763 content::RecordAction(UserMetricsAction("Star")); 763 content::RecordAction(UserMetricsAction("Star"));
764 764
765 BookmarkModel* model = 765 BookmarkModel* model =
766 BookmarkModelFactory::GetForBrowserContext(browser->profile()); 766 BookmarkModelFactory::GetForBrowserContext(browser->profile());
767 if (!model || !model->loaded()) 767 if (!model || !model->loaded())
768 return; // Ignore requests until bookmarks are loaded. 768 return; // Ignore requests until bookmarks are loaded.
769 769
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1334 true)); 1334 true));
1335 app_browser->tab_strip_model()->AppendWebContents(contents, true); 1335 app_browser->tab_strip_model()->AppendWebContents(contents, true);
1336 1336
1337 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 1337 contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
1338 contents->GetRenderViewHost()->SyncRendererPrefs(); 1338 contents->GetRenderViewHost()->SyncRendererPrefs();
1339 app_browser->window()->Show(); 1339 app_browser->window()->Show();
1340 } 1340 }
1341 #endif // BUILDFLAG(ENABLE_EXTENSIONS) 1341 #endif // BUILDFLAG(ENABLE_EXTENSIONS)
1342 1342
1343 } // namespace chrome 1343 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698