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

Side by Side Diff: chrome/browser/ui/extensions/shell_window.cc

Issue 11369237: Add a way to fetch window frame metrics from NativeShellWindow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: change ShellWindowViews frame insets logic Created 8 years, 1 month 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/extensions/shell_window.h" 5 #include "chrome/browser/ui/extensions/shell_window.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/extension_process_manager.h" 8 #include "chrome/browser/extensions/extension_process_manager.h"
9 #include "chrome/browser/extensions/extension_system.h" 9 #include "chrome/browser/extensions/extension_system.h"
10 #include "chrome/browser/extensions/shell_window_geometry_cache.h" 10 #include "chrome/browser/extensions/shell_window_geometry_cache.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 native_window_->HandleKeyboardEvent(event); 280 native_window_->HandleKeyboardEvent(event);
281 } 281 }
282 282
283 void ShellWindow::OnNativeClose() { 283 void ShellWindow::OnNativeClose() {
284 extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this); 284 extensions::ShellWindowRegistry::Get(profile_)->RemoveShellWindow(this);
285 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost(); 285 content::RenderViewHost* rvh = web_contents_->GetRenderViewHost();
286 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID())); 286 rvh->Send(new ExtensionMsg_AppWindowClosed(rvh->GetRoutingID()));
287 delete this; 287 delete this;
288 } 288 }
289 289
290 BaseWindow* ShellWindow::GetBaseWindow() { 290 NativeShellWindow* ShellWindow::GetBaseWindow() {
291 return native_window_.get(); 291 return native_window_.get();
292 } 292 }
293 293
294 gfx::NativeWindow ShellWindow::GetNativeWindow() {
295 return GetBaseWindow()->GetNativeWindow();
296 }
297
294 string16 ShellWindow::GetTitle() const { 298 string16 ShellWindow::GetTitle() const {
295 // WebContents::GetTitle() will return the page's URL if there's no <title> 299 // WebContents::GetTitle() will return the page's URL if there's no <title>
296 // specified. However, we'd prefer to show the name of the extension in that 300 // specified. However, we'd prefer to show the name of the extension in that
297 // case, so we directly inspect the NavigationEntry's title. 301 // case, so we directly inspect the NavigationEntry's title.
298 if (!web_contents()->GetController().GetActiveEntry() || 302 if (!web_contents()->GetController().GetActiveEntry() ||
299 web_contents()->GetController().GetActiveEntry()->GetTitle().empty()) 303 web_contents()->GetController().GetActiveEntry()->GetTitle().empty())
300 return UTF8ToUTF16(extension()->name()); 304 return UTF8ToUTF16(extension()->name());
301 string16 title = web_contents()->GetTitle(); 305 string16 title = web_contents()->GetTitle();
302 Browser::FormatTitleForDisplay(&title); 306 Browser::FormatTitleForDisplay(&title);
303 return title; 307 return title;
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 const extensions::DraggableRegion& region = *iter; 509 const extensions::DraggableRegion& region = *iter;
506 sk_region->op( 510 sk_region->op(
507 region.bounds.x(), 511 region.bounds.x(),
508 region.bounds.y(), 512 region.bounds.y(),
509 region.bounds.right(), 513 region.bounds.right(),
510 region.bounds.bottom(), 514 region.bounds.bottom(),
511 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 515 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
512 } 516 }
513 return sk_region; 517 return sk_region;
514 } 518 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698