OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 browser->CreateBrowserWindow(); | 369 browser->CreateBrowserWindow(); |
370 return browser; | 370 return browser; |
371 } | 371 } |
372 | 372 |
373 void Browser::CreateBrowserWindow() { | 373 void Browser::CreateBrowserWindow() { |
374 DCHECK(!window_); | 374 DCHECK(!window_); |
375 | 375 |
376 window_ = BrowserWindow::CreateBrowserWindow(this); | 376 window_ = BrowserWindow::CreateBrowserWindow(this); |
377 | 377 |
378 #if defined(OS_WIN) | 378 #if defined(OS_WIN) |
379 { | 379 // Set the app user model id for this application to that of the application |
380 // TODO: This might hit the disk | 380 // name. See http://crbug.com/7028. |
381 // http://code.google.com/p/chromium/issues/detail?id=61638 | 381 win_util::SetAppIdForWindow( |
382 base::ThreadRestrictions::ScopedAllowIO allow_io; | 382 type_ & TYPE_APP ? |
383 | 383 ShellIntegration::GetAppId(UTF8ToWide(app_name_), profile_->GetPath()) : |
384 // Set the app user model id for this application to that of the application | 384 ShellIntegration::GetChromiumAppId(profile_->GetPath()), |
385 // name. See http://crbug.com/7028. | 385 window()->GetNativeHandle()); |
386 win_util::SetAppIdForWindow( | |
387 type_ & TYPE_APP ? | |
388 ShellIntegration::GetAppId(UTF8ToWide(app_name_), profile_->GetPath()) : | |
389 ShellIntegration::GetChromiumAppId(profile_->GetPath()), | |
390 window()->GetNativeHandle()); | |
391 } | |
392 #endif | 386 #endif |
393 | 387 |
394 NotificationService::current()->Notify( | 388 NotificationService::current()->Notify( |
395 NotificationType::BROWSER_WINDOW_READY, | 389 NotificationType::BROWSER_WINDOW_READY, |
396 Source<Browser>(this), | 390 Source<Browser>(this), |
397 NotificationService::NoDetails()); | 391 NotificationService::NoDetails()); |
398 | 392 |
399 // Show the First Run information bubble if we've been told to. | 393 // Show the First Run information bubble if we've been told to. |
400 PrefService* local_state = g_browser_process->local_state(); | 394 PrefService* local_state = g_browser_process->local_state(); |
401 if (!local_state) | 395 if (!local_state) |
(...skipping 3671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4073 NOTREACHED(); | 4067 NOTREACHED(); |
4074 return false; | 4068 return false; |
4075 } | 4069 } |
4076 | 4070 |
4077 void Browser::CreateInstantIfNecessary() { | 4071 void Browser::CreateInstantIfNecessary() { |
4078 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && | 4072 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && |
4079 !profile()->IsOffTheRecord()) { | 4073 !profile()->IsOffTheRecord()) { |
4080 instant_.reset(new InstantController(profile_, this)); | 4074 instant_.reset(new InstantController(profile_, this)); |
4081 } | 4075 } |
4082 } | 4076 } |
OLD | NEW |