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

Unified Diff: apps/app_window.cc

Issue 306823002: Flip --enable-apps-show-on-first-paint flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tests Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apps/app_window.h ('k') | apps/app_window_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apps/app_window.cc
diff --git a/apps/app_window.cc b/apps/app_window.cc
index 6412b1041ba6fabfa67aacdc51131a653731a2e6..ece3bcbbf53ae5ef7041929ed00a5c7540e061ec 100644
--- a/apps/app_window.cc
+++ b/apps/app_window.cc
@@ -238,6 +238,7 @@ AppWindow::AppWindow(BrowserContext* context,
fullscreen_types_(FULLSCREEN_TYPE_NONE),
show_on_first_paint_(false),
first_paint_complete_(false),
+ has_been_shown_(false),
is_hidden_(false),
cached_always_on_top_(false) {
extensions::ExtensionsBrowserClient* client =
@@ -253,8 +254,8 @@ void AppWindow::Init(const GURL& url,
app_window_contents_.reset(app_window_contents);
app_window_contents_->Initialize(browser_context(), url);
WebContents* web_contents = app_window_contents_->GetWebContents();
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableAppsShowOnFirstPaint)) {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableAppsShowOnFirstPaint)) {
content::WebContentsObserver::Observe(web_contents);
}
delegate_->InitWebContents(web_contents);
@@ -326,8 +327,8 @@ void AppWindow::Init(const GURL& url,
app_window_contents_->LoadContents(new_params.creator_process_id);
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableAppsShowOnFirstPaint)) {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableAppsShowOnFirstPaint)) {
// We want to show the window only when the content has been painted. For
// that to happen, we need to define a size for the content, otherwise the
// layout will happen in a 0x0 area.
@@ -679,8 +680,8 @@ void AppWindow::SetContentSizeConstraints(const gfx::Size& min_size,
void AppWindow::Show(ShowType show_type) {
is_hidden_ = false;
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableAppsShowOnFirstPaint)) {
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableAppsShowOnFirstPaint)) {
show_on_first_paint_ = true;
if (!first_paint_complete_) {
@@ -698,6 +699,11 @@ void AppWindow::Show(ShowType show_type) {
break;
}
AppWindowRegistry::Get(browser_context_)->AppWindowShown(this);
+
+ if (!has_been_shown_) {
+ has_been_shown_ = true;
+ app_window_contents_->NativeWindowFirstShown();
+ }
}
void AppWindow::Hide() {
« no previous file with comments | « apps/app_window.h ('k') | apps/app_window_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698