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

Side by Side Diff: chrome/browser/ui/views/aura/chrome_shell_delegate.cc

Issue 8938007: Makes creating a new browser from the launcher use default profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | Annotate | Revision Log
« 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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/views/aura/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/views/aura/chrome_shell_delegate.h"
6 6
7 #include "chrome/browser/profiles/profile_manager.h" 7 #include "chrome/browser/profiles/profile_manager.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/views/aura/app_list_window.h" 9 #include "chrome/browser/ui/views/aura/app_list_window.h"
10 #include "chrome/browser/ui/views/aura/status_area_host_aura.h" 10 #include "chrome/browser/ui/views/aura/status_area_host_aura.h"
(...skipping 27 matching lines...) Expand all
38 return true; 38 return true;
39 } 39 }
40 if (browser->is_app()) { 40 if (browser->is_app()) {
41 *type = aura_shell::TYPE_APP; 41 *type = aura_shell::TYPE_APP;
42 return true; 42 return true;
43 } 43 }
44 return false; 44 return false;
45 } 45 }
46 46
47 void ChromeShellDelegate::CreateNewWindow() { 47 void ChromeShellDelegate::CreateNewWindow() {
48 Browser* browser = Browser::Create( 48 Browser* browser = Browser::Create(ProfileManager::GetDefaultProfile());
49 ProfileManager::GetDefaultProfile()->GetOriginalProfile());
50 browser->AddSelectedTabWithURL(GURL(), content::PAGE_TRANSITION_START_PAGE); 49 browser->AddSelectedTabWithURL(GURL(), content::PAGE_TRANSITION_START_PAGE);
51 browser->window()->Show(); 50 browser->window()->Show();
52 } 51 }
53 52
54 views::Widget* ChromeShellDelegate::CreateStatusArea() { 53 views::Widget* ChromeShellDelegate::CreateStatusArea() {
55 status_area_host_.reset(new StatusAreaHostAura()); 54 status_area_host_.reset(new StatusAreaHostAura());
56 views::Widget* status_area_widget = 55 views::Widget* status_area_widget =
57 status_area_host_.get()->CreateStatusArea(); 56 status_area_host_.get()->CreateStatusArea();
58 return status_area_widget; 57 return status_area_widget;
59 } 58 }
60 59
61 void ChromeShellDelegate::RequestAppListWidget( 60 void ChromeShellDelegate::RequestAppListWidget(
62 const gfx::Rect& bounds, 61 const gfx::Rect& bounds,
63 const SetWidgetCallback& callback) { 62 const SetWidgetCallback& callback) {
64 // AppListWindow deletes itself when closed. 63 // AppListWindow deletes itself when closed.
65 new AppListWindow(bounds, callback); 64 new AppListWindow(bounds, callback);
66 } 65 }
67 66
68 void ChromeShellDelegate::LauncherItemClicked( 67 void ChromeShellDelegate::LauncherItemClicked(
69 const aura_shell::LauncherItem& item) { 68 const aura_shell::LauncherItem& item) {
70 aura_shell::ActivateWindow(item.window); 69 aura_shell::ActivateWindow(item.window);
71 } 70 }
72 71
73 bool ChromeShellDelegate::ConfigureLauncherItem( 72 bool ChromeShellDelegate::ConfigureLauncherItem(
74 aura_shell::LauncherItem* item) { 73 aura_shell::LauncherItem* item) {
75 BrowserView* view = BrowserView::GetBrowserViewForNativeWindow(item->window); 74 BrowserView* view = BrowserView::GetBrowserViewForNativeWindow(item->window);
76 return view && 75 return view &&
77 ShouldCreateLauncherItemForBrowser(view->browser(), &(item->type)); 76 ShouldCreateLauncherItemForBrowser(view->browser(), &(item->type));
78 } 77 }
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