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

Side by Side Diff: apps/shell_window.cc

Issue 102843002: Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « no previous file | ash/system/user/tray_user.cc » ('j') | chrome/test/ppapi/ppapi_test.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/shell_window_geometry_cache.h" 7 #include "apps/shell_window_geometry_cache.h"
8 #include "apps/shell_window_registry.h" 8 #include "apps/shell_window_registry.h"
9 #include "apps/ui/native_app_window.h" 9 #include "apps/ui/native_app_window.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 gfx::NativeWindow ShellWindow::GetNativeWindow() { 377 gfx::NativeWindow ShellWindow::GetNativeWindow() {
378 return GetBaseWindow()->GetNativeWindow(); 378 return GetBaseWindow()->GetNativeWindow();
379 } 379 }
380 380
381 gfx::Rect ShellWindow::GetClientBounds() const { 381 gfx::Rect ShellWindow::GetClientBounds() const {
382 gfx::Rect bounds = native_app_window_->GetBounds(); 382 gfx::Rect bounds = native_app_window_->GetBounds();
383 bounds.Inset(native_app_window_->GetFrameInsets()); 383 bounds.Inset(native_app_window_->GetFrameInsets());
384 return bounds; 384 return bounds;
385 } 385 }
386 386
387 string16 ShellWindow::GetTitle() const { 387 base::string16 ShellWindow::GetTitle() const {
388 // WebContents::GetTitle() will return the page's URL if there's no <title> 388 // WebContents::GetTitle() will return the page's URL if there's no <title>
389 // specified. However, we'd prefer to show the name of the extension in that 389 // specified. However, we'd prefer to show the name of the extension in that
390 // case, so we directly inspect the NavigationEntry's title. 390 // case, so we directly inspect the NavigationEntry's title.
391 string16 title; 391 base::string16 title;
392 if (!web_contents() || 392 if (!web_contents() ||
393 !web_contents()->GetController().GetActiveEntry() || 393 !web_contents()->GetController().GetActiveEntry() ||
394 web_contents()->GetController().GetActiveEntry()->GetTitle().empty()) { 394 web_contents()->GetController().GetActiveEntry()->GetTitle().empty()) {
395 title = UTF8ToUTF16(extension()->name()); 395 title = UTF8ToUTF16(extension()->name());
396 } else { 396 } else {
397 title = web_contents()->GetTitle(); 397 title = web_contents()->GetTitle();
398 } 398 }
399 const char16 kBadChars[] = { '\n', 0 }; 399 const base::char16 kBadChars[] = { '\n', 0 };
400 RemoveChars(title, kBadChars, &title); 400 base::RemoveChars(title, kBadChars, &title);
401 return title; 401 return title;
402 } 402 }
403 403
404 void ShellWindow::SetAppIconUrl(const GURL& url) { 404 void ShellWindow::SetAppIconUrl(const GURL& url) {
405 // Avoid using any previous app icons were are being downloaded. 405 // Avoid using any previous app icons were are being downloaded.
406 image_loader_ptr_factory_.InvalidateWeakPtrs(); 406 image_loader_ptr_factory_.InvalidateWeakPtrs();
407 407
408 // Reset |app_icon_image_| to abort pending image load (if any). 408 // Reset |app_icon_image_| to abort pending image load (if any).
409 app_icon_image_.reset(); 409 app_icon_image_.reset();
410 410
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 region.bounds.x(), 830 region.bounds.x(),
831 region.bounds.y(), 831 region.bounds.y(),
832 region.bounds.right(), 832 region.bounds.right(),
833 region.bounds.bottom(), 833 region.bounds.bottom(),
834 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 834 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
835 } 835 }
836 return sk_region; 836 return sk_region;
837 } 837 }
838 838
839 } // namespace apps 839 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | ash/system/user/tray_user.cc » ('j') | chrome/test/ppapi/ppapi_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698