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

Side by Side Diff: chrome/browser/extensions/extension_tabs_module.cc

Issue 7647026: base: Add three helper functions to Values API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix a typo Ceate -> Create Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extension_tabs_module.h" 5 #include "chrome/browser/extensions/extension_tabs_module.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 } 583 }
584 new_window->SelectNumberedTab(0); 584 new_window->SelectNumberedTab(0);
585 585
586 if (focused) 586 if (focused)
587 new_window->window()->Show(); 587 new_window->window()->Show();
588 else 588 else
589 new_window->window()->ShowInactive(); 589 new_window->window()->ShowInactive();
590 590
591 if (new_window->profile()->IsOffTheRecord() && !include_incognito()) { 591 if (new_window->profile()->IsOffTheRecord() && !include_incognito()) {
592 // Don't expose incognito windows if the extension isn't allowed. 592 // Don't expose incognito windows if the extension isn't allowed.
593 result_.reset(Value::CreateNullValue()); 593 result_.reset(base::NullValue());
594 } else { 594 } else {
595 result_.reset(ExtensionTabUtil::CreateWindowValue(new_window, true)); 595 result_.reset(ExtensionTabUtil::CreateWindowValue(new_window, true));
596 } 596 }
597 597
598 return true; 598 return true;
599 } 599 }
600 600
601 bool UpdateWindowFunction::RunImpl() { 601 bool UpdateWindowFunction::RunImpl() {
602 int window_id; 602 int window_id;
603 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &window_id)); 603 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &window_id));
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 // called for every API call the extension made. 1376 // called for every API call the extension made.
1377 GotLanguage(language); 1377 GotLanguage(language);
1378 } 1378 }
1379 1379
1380 void DetectTabLanguageFunction::GotLanguage(const std::string& language) { 1380 void DetectTabLanguageFunction::GotLanguage(const std::string& language) {
1381 result_.reset(Value::CreateStringValue(language.c_str())); 1381 result_.reset(Value::CreateStringValue(language.c_str()));
1382 SendResponse(true); 1382 SendResponse(true);
1383 1383
1384 Release(); // Balanced in Run() 1384 Release(); // Balanced in Run()
1385 } 1385 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_prefs.cc ('k') | chrome/browser/extensions/extension_webnavigation_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698