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

Side by Side Diff: chrome/browser/extensions/api/tabs/tabs.cc

Issue 11072002: Combined window positioning and show state determiniation in the WindowSizer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed more build issues Created 8 years, 2 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 (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/extensions/api/tabs/tabs.h" 5 #include "chrome/browser/extensions/api/tabs/tabs.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 #else 524 #else
525 if (Browser::TYPE_TABBED == window_type) { 525 if (Browser::TYPE_TABBED == window_type) {
526 #endif 526 #endif
527 // Try to position the new browser relative to its originating 527 // Try to position the new browser relative to its originating
528 // browser window. The call offsets the bounds by kWindowTilePixels 528 // browser window. The call offsets the bounds by kWindowTilePixels
529 // (defined in WindowSizer to be 10). 529 // (defined in WindowSizer to be 10).
530 // 530 //
531 // NOTE(rafaelw): It's ok if GetCurrentBrowser() returns NULL here. 531 // NOTE(rafaelw): It's ok if GetCurrentBrowser() returns NULL here.
532 // GetBrowserWindowBounds will default to saved "default" values for 532 // GetBrowserWindowBounds will default to saved "default" values for
533 // the app. 533 // the app.
534 WindowSizer::GetBrowserWindowBounds(std::string(), gfx::Rect(), 534 ui::WindowShowState show_state;
535 GetCurrentBrowser(), 535 WindowSizer::GetBrowserWindowBoundsAndShowState(std::string(),
536 &window_bounds); 536 gfx::Rect(),
537 GetCurrentBrowser(),
538 &window_bounds,
539 &show_state);
537 } 540 }
538 541
539 if (Browser::TYPE_PANEL == window_type && 542 if (Browser::TYPE_PANEL == window_type &&
540 PanelManager::CREATE_AS_DETACHED == panel_create_mode) { 543 PanelManager::CREATE_AS_DETACHED == panel_create_mode) {
541 window_bounds.set_origin( 544 window_bounds.set_origin(
542 PanelManager::GetInstance()->GetDefaultDetachedPanelOrigin()); 545 PanelManager::GetInstance()->GetDefaultDetachedPanelOrigin());
543 } 546 }
544 547
545 // Any part of the bounds can optionally be set by the caller. 548 // Any part of the bounds can optionally be set by the caller.
546 int bounds_val = -1; 549 int bounds_val = -1;
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
1864 // called for every API call the extension made. 1867 // called for every API call the extension made.
1865 GotLanguage(language); 1868 GotLanguage(language);
1866 } 1869 }
1867 1870
1868 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { 1871 void DetectTabLanguageFunction::GotLanguage(const std::string& language) {
1869 SetResult(Value::CreateStringValue(language.c_str())); 1872 SetResult(Value::CreateStringValue(language.c_str()));
1870 SendResponse(true); 1873 SendResponse(true);
1871 1874
1872 Release(); // Balanced in Run() 1875 Release(); // Balanced in Run()
1873 } 1876 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698