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