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

Side by Side Diff: apps/shell_window.cc

Issue 23618036: Merge NOTIFICATION_RENDER_VIEW_HOST_CHANGED into NOTIFICATION_WEB_CONTENTS_SWAPPED. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "apps/shell_window.h" 5 #include "apps/shell_window.h"
6 6
7 #include "apps/native_app_window.h" 7 #include "apps/native_app_window.h"
8 #include "apps/shell_window_geometry_cache.h" 8 #include "apps/shell_window_geometry_cache.h"
9 #include "apps/shell_window_registry.h" 9 #include "apps/shell_window_registry.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 Maximize(); 176 Maximize();
177 else if (new_params.state == ui::SHOW_STATE_MINIMIZED) 177 else if (new_params.state == ui::SHOW_STATE_MINIMIZED)
178 Minimize(); 178 Minimize();
179 179
180 OnNativeWindowChanged(); 180 OnNativeWindowChanged();
181 181
182 // When the render view host is changed, the native window needs to know 182 // When the render view host is changed, the native window needs to know
183 // about it in case it has any setup to do to make the renderer appear 183 // about it in case it has any setup to do to make the renderer appear
184 // properly. In particular, on Windows, the view's clickthrough region needs 184 // properly. In particular, on Windows, the view's clickthrough region needs
185 // to be set. 185 // to be set.
186 registrar_.Add(this, content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED, 186 registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_SWAPPED,
187 content::Source<content::NavigationController>( 187 content::Source<content::WebContents>(web_contents));
188 &web_contents->GetController()));
189 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 188 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
190 content::Source<Profile>(profile_)); 189 content::Source<Profile>(profile_));
191 // Close when the browser process is exiting. 190 // Close when the browser process is exiting.
192 registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING, 191 registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING,
193 content::NotificationService::AllSources()); 192 content::NotificationService::AllSources());
194 193
195 shell_window_contents_->LoadContents(params.creator_process_id); 194 shell_window_contents_->LoadContents(params.creator_process_id);
196 195
197 // Prevent the browser process from shutting down while this window is open. 196 // Prevent the browser process from shutting down while this window is open.
198 chrome::StartKeepAlive(); 197 chrome::StartKeepAlive();
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 526
528 bool ShellWindow::IsFullscreenForTabOrPending( 527 bool ShellWindow::IsFullscreenForTabOrPending(
529 const content::WebContents* source) const { 528 const content::WebContents* source) const {
530 return fullscreen_for_tab_; 529 return fullscreen_for_tab_;
531 } 530 }
532 531
533 void ShellWindow::Observe(int type, 532 void ShellWindow::Observe(int type,
534 const content::NotificationSource& source, 533 const content::NotificationSource& source,
535 const content::NotificationDetails& details) { 534 const content::NotificationDetails& details) {
536 switch (type) { 535 switch (type) {
537 case content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED: { 536 case content::NOTIFICATION_WEB_CONTENTS_SWAPPED: {
538 // TODO(jianli): once http://crbug.com/123007 is fixed, we'll no longer 537 // TODO(jianli): once http://crbug.com/123007 is fixed, we'll no longer
539 // need to make the native window (ShellWindowViews specially) update 538 // need to make the native window (ShellWindowViews specially) update
540 // the clickthrough region for the new RVH. 539 // the clickthrough region for the new RVH.
541 native_app_window_->RenderViewHostChanged(); 540 native_app_window_->RenderViewHostChanged();
542 break; 541 break;
543 } 542 }
544 case chrome::NOTIFICATION_EXTENSION_UNLOADED: { 543 case chrome::NOTIFICATION_EXTENSION_UNLOADED: {
545 const extensions::Extension* unloaded_extension = 544 const extensions::Extension* unloaded_extension =
546 content::Details<extensions::UnloadedExtensionInfo>( 545 content::Details<extensions::UnloadedExtensionInfo>(
547 details)->extension; 546 details)->extension;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 region.bounds.x(), 644 region.bounds.x(),
646 region.bounds.y(), 645 region.bounds.y(),
647 region.bounds.right(), 646 region.bounds.right(),
648 region.bounds.bottom(), 647 region.bounds.bottom(),
649 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 648 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
650 } 649 }
651 return sk_region; 650 return sk_region;
652 } 651 }
653 652
654 } // namespace apps 653 } // namespace apps
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698