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

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

Issue 159336: Partial fix to 7028 - Pinning in Win7.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « app/win_util.cc ('k') | 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/browser.h" 5 #include "chrome/browser/browser.h"
6 6
7 #include "app/animation.h" 7 #include "app/animation.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/idle_timer.h" 10 #include "base/idle_timer.h"
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 340
341 // static 341 // static
342 void Browser::OpenApplicationWindow(Profile* profile, const GURL& url) { 342 void Browser::OpenApplicationWindow(Profile* profile, const GURL& url) {
343 std::wstring app_name = ComputeApplicationNameFromURL(url); 343 std::wstring app_name = ComputeApplicationNameFromURL(url);
344 RegisterAppPrefs(app_name); 344 RegisterAppPrefs(app_name);
345 345
346 Browser* browser = Browser::CreateForApp(app_name, profile, false); 346 Browser* browser = Browser::CreateForApp(app_name, profile, false);
347 browser->AddTabWithURL(url, GURL(), PageTransition::START_PAGE, true, -1, 347 browser->AddTabWithURL(url, GURL(), PageTransition::START_PAGE, true, -1,
348 false, NULL); 348 false, NULL);
349 349
350 #if defined(OS_WIN)
351 // Set the app user model id for this application to that of the application
352 // name. See http://crbug.com/7028.
353 win_util::SetAppIdForWindow(app_name, browser->window()->GetNativeHandle());
354 #endif
355
350 TabContents* tab_contents = browser->GetSelectedTabContents(); 356 TabContents* tab_contents = browser->GetSelectedTabContents();
351 tab_contents->GetMutableRendererPrefs()->can_accept_load_drops = false; 357 tab_contents->GetMutableRendererPrefs()->can_accept_load_drops = false;
352 tab_contents->render_view_host()->SyncRendererPrefs(); 358 tab_contents->render_view_host()->SyncRendererPrefs();
353 browser->window()->Show(); 359 browser->window()->Show();
354 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial 360 // TODO(jcampan): http://crbug.com/8123 we should not need to set the initial
355 // focus explicitly. 361 // focus explicitly.
356 tab_contents->view()->SetInitialFocus(); 362 tab_contents->view()->SetInitialFocus();
357 } 363 }
358 364
359 /////////////////////////////////////////////////////////////////////////////// 365 ///////////////////////////////////////////////////////////////////////////////
(...skipping 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after
2774 /////////////////////////////////////////////////////////////////////////////// 2780 ///////////////////////////////////////////////////////////////////////////////
2775 // BrowserToolbarModel (private): 2781 // BrowserToolbarModel (private):
2776 2782
2777 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { 2783 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() {
2778 // This |current_tab| can be NULL during the initialization of the 2784 // This |current_tab| can be NULL during the initialization of the
2779 // toolbar during window creation (i.e. before any tabs have been added 2785 // toolbar during window creation (i.e. before any tabs have been added
2780 // to the window). 2786 // to the window).
2781 TabContents* current_tab = browser_->GetSelectedTabContents(); 2787 TabContents* current_tab = browser_->GetSelectedTabContents();
2782 return current_tab ? &current_tab->controller() : NULL; 2788 return current_tab ? &current_tab->controller() : NULL;
2783 } 2789 }
OLDNEW
« no previous file with comments | « app/win_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698