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

Side by Side Diff: chrome/browser/chromeos/ui/app_launch_view.cc

Issue 18179004: Dismiss action in tab modal dialogs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test for Mac Created 7 years, 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/chromeos/ui/app_launch_view.h" 5 #include "chrome/browser/chromeos/ui/app_launch_view.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_delegate.h" 8 #include "ash/shell_delegate.h"
9 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 void AppLaunchView::UpdateAppLaunchState(AppLaunchState state) { 72 void AppLaunchView::UpdateAppLaunchState(AppLaunchState state) {
73 if (g_instance) 73 if (g_instance)
74 g_instance->UpdateState(state); 74 g_instance->UpdateState(state);
75 } 75 }
76 76
77 77
78 // static 78 // static
79 void AppLaunchView::CloseAppLaunchSplashScreen() { 79 void AppLaunchView::CloseAppLaunchSplashScreen() {
80 if (g_instance) { 80 if (g_instance) {
81 g_instance->Close(); 81 g_instance->GetWidget()->Close();
82 g_instance = NULL; 82 g_instance = NULL;
83 } 83 }
84 } 84 }
85 85
86 //////////////////////////////////////////////////////////////////////////////// 86 ////////////////////////////////////////////////////////////////////////////////
87 // AppLaunchView, views::WidgetDelegateView implementation. 87 // AppLaunchView, views::WidgetDelegateView implementation.
88 views::View* AppLaunchView::GetContentsView() { 88 views::View* AppLaunchView::GetContentsView() {
89 return this; 89 return this;
90 } 90 }
91 91
(...skipping 21 matching lines...) Expand all
113 void AppLaunchView::Show() { 113 void AppLaunchView::Show() {
114 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 114 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
115 // Add the WebView to our view. 115 // Add the WebView to our view.
116 AddChildWebContents(); 116 AddChildWebContents();
117 // Initialize container window. 117 // Initialize container window.
118 InitializeWindow(); 118 InitializeWindow();
119 // Show the window. 119 // Show the window.
120 ShowWindow(); 120 ShowWindow();
121 } 121 }
122 122
123 void AppLaunchView::Close() {
124 DCHECK(GetWidget());
125 GetWidget()->Close();
126 }
127
128 void AppLaunchView::AddChildWebContents() { 123 void AppLaunchView::AddChildWebContents() {
129 content::BrowserContext* context = 124 content::BrowserContext* context =
130 ash::Shell::GetInstance()->delegate()->GetCurrentBrowserContext(); 125 ash::Shell::GetInstance()->delegate()->GetCurrentBrowserContext();
131 app_launch_webview_ = new views::WebView(context); 126 app_launch_webview_ = new views::WebView(context);
132 SetLayoutManager(new views::FillLayout); 127 SetLayoutManager(new views::FillLayout);
133 AddChildView(app_launch_webview_); 128 AddChildView(app_launch_webview_);
134 129
135 LoadSplashScreen(); 130 LoadSplashScreen();
136 content::WebContentsObserver::Observe( 131 content::WebContentsObserver::Observe(
137 app_launch_webview_->GetWebContents()); 132 app_launch_webview_->GetWebContents());
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 } 185 }
191 186
192 void AppLaunchView::ShowWindow() { 187 void AppLaunchView::ShowWindow() {
193 DCHECK(container_window_); 188 DCHECK(container_window_);
194 container_window_->Show(); 189 container_window_->Show();
195 } 190 }
196 191
197 } // namespace internal 192 } // namespace internal
198 193
199 } // namespace chromeos 194 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/ui/app_launch_view.h ('k') | chrome/browser/chromeos/ui/idle_logout_dialog_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698